MATLAB: How to make axes have proportional scales

axisMATLAB

Hi, I would like the x and y axes on my surf plot to have proportional scales. I am plotting temperature over a 2D plane. I want to visualise the temperature profile but the x and y axes stretch to fit the figure window, stretching the temperature profile.
I want the axes to have the same 'unit:distance on screen' ratio. How can I do this? I have been finding the aspect ratio help not very helpful Thanks

Best Answer

If you want them to have equal scales then
axis equal
Otherwise set the axes DataAspectRatio property. For example,
set(gca,'DataAspectRatio',[10 1 1])
would mean that every 10 units of x is to have the same size as one unit of y -- which would make something of x width 10 and y height 1 into a square.