MATLAB: When I plot a 3D figure, how can I avoid changing its size when I rotate it in MATLAB 7.5 (R2007b)

aspectchangeMATLABpropertiesratio

I would like to be able to avoid changing the size of the 3-D figure when I rotate it.

Best Answer

To have a 3D figure keep its size while rotating it, change the following properties:
surf(peaks)
set(gca,'DataAspectRatioMode','manual');
set(gca,'PlotBoxAspectRatioMode','manual');
set(gca,'CameraViewAngleMode','manual');