With interpolation we can achieve this. Initially, we have 8 values. We want to interpolate these so we have for example 100 values instead of just 8. In case you are not familiar with interpolation, the initial values will still be in place and all values we add in between will work as a gradient between the values we already have.
In our case, we are interpolating in only 1 dimension and can use interp1.
Y = 1000 * [4.1962 3.5087 2.8783 2.3026 1.7775 1.2967 0.8516 0.4318]';
Y = interp1(Y, linspace(1,8))';
figure (2)
imagesc (Y)
axis ([-3 5 0 100])
axis off
colorbar
The second argument of interp1 is linspace(1,8). The default behaviour of linspace is to create 100 evenly spaced values starting with the first argument and ending with the last. These are the x-values where we are interpolating. In this case we don't really have any x-values, but since interp1 thinks of all our Y-values as a function of x, it assumes that the indexes of Y are the x-values if we don't give it any further instructions.
Finally, we change the axis to be more similar to the image you posted in the question and get the following.
Before...
After...
