Your coordinate grid matrices x and y are not "aligned" with the axes. You can see this if you just do
So I would say your pcolor code is giving you the correct rendering, and imagesc behavior seems anomalous, since your values of x and y (called x_vect and y_vect in your code), do not follow the requirements of imagesc:
per the documentation, x and y should either be vectors of respective lengths size(Tair_mean), or 2-element vectors specifying only the corner coordinates (implicitly assume on a rectangular canvas aligned with axes), or scalars specifying only 1 corner. As you supply the entire grid in a long vector, it must be assuming you only care about the first and last points, or something like that.
If you want to align with axes, I guess you have 2 options:
- Forget about the actual coordinate values and simply issue