Question: Is it possible in `imagesc` to specify the x-axis a column vector such that the ticks and data points(pixels) are placed on the corresponding points? As far as I understood from the manual you only specify the corners of the image and this is not a problem as long as your data is **evenly spaced** like `100:100:1000`. 

In my case the x-axis consists of 21 elements which are evenly spaced like `1200:50:1700`, whereas the y-axis is the vertical concatenation of two evenly spaced column vectors `200:50:450` and `500:25:725`. My aim is to have the data points(pixels) at the correct locations, but it seems impossible to do so. Is there a workaround?

Answer: 
Try replace `imagesc` with `surf` command:

```
surf(1200:50:1700, [200:50:450 500:25:725], rand(16,11), 'EdgeColor','none');
view([0 90]);

```

Note: with this way you loose last column and last row compare to `imagesc`, but you can just duplicated these data before displaying.
Use contourf or interpolate the data to a grid that fits all data points using e.g. interp2 or plot using contourf

Initialize data

```
X=[1200:50:1700]
Y=[200:50:450 500:25:725]

V = peaks(max(size(X,2),size(Y,2)))(1:size(Y,2),1:size(X,2));

```

Plot using contourf

```
contourf(X,Y,V);
view([0 -90]);

```

Interpolate and plot

```
Xq=linspace(min(X),max(X),100);
Yq=linspace(min(Y),max(Y),100)';
Vq = interp2(X,Y,V,Xq,Yq,'nearest');
imagesc(Vq)

```

If you want to have your pixels exactly at the correct location, you need to use a grid that has points exactly at all the point of your Y vector of course, so you need to adjust the "100"s accordingly to your screen and data resolution.

The alternative is to use pcolor

```
pcolor(X,Y,V)
view([0 -90]);

```

(Be careful with all the up-down flipping between image data and real data)