Search code examples
matlabmatlab-figure

Turn a Matlab figure in 'axis square'


Suppose I have received a figure from my colleague, i.e I wouldn't build the figure by myself, and I not necessarily know hot to plot it.

I want to turn the figure's axis into 'axis square' or 'axis equal'. I am familiar with the axis style command, only when imposing it on my figure from the command line, and not in the situation mentioned.

How could this be done?


Solution

  • Just open the figure and issue the axis equal command:

    f = open('myfigure.fig');
    axis equal
    

    You can then save the figure in the normal way to a new file. Commands like axis equal always operate on the "current figure", which is usually the figure most recently plotted to, or selected.