Search code examples
matlabresizescalingfigure

matlab: figure size, same axis size


I have a figure with fixed size, like that:

hFig = figure(1);
set(hFig, 'Position', [200 200 500 500])

But the thing is, that I want to have my AXIS with fixed size (i want them to be a square), not (necessary) the whole figure... - see image attached, Y axis is a bit longer than X axis (of course longer in a meaning of display... X and Y axis range is set to the same value). How to adjust it?

Thanks!

particle trajectory


Solution

  • Use axis equal to set the spacing of the axis to be the same.