MATLAB: Matlab App Designer UIAxes same scale for x and y axis

appdesignerMATLABuiaxis

Hi I'm looking for a command to have the same scale for x and y axis in my app.UIAxis plot.
unfortuantely set(gca,'DataAspectRatio',[10 1 1]) doesn't work since it opens a new figure instead of changing the axis scale in my plot.
Thanks a lot and best regards.

Best Answer

Check out linkaxes and linkprop. Use them to set the axis limits and, if needed, other axis properties between two axes.
The reason why your set() command didn't work is because you need to specify the axis handle.
set(app.UIAxes,'DataAspectRatio',[10 1 1])
% ^^^^^^^^^^ or whatever your axis handle is
Related Question