How can I zoom in and out of 3-D plots within MATLAB?

15 views (last 30 days)
The following example allows me to zoom in a 3-D plot:
mesh(peaks)
axis vis3d
zoom(2)
But there is no way to zoom out:
zoom(-2)
??? Error using ==> set
Property value must be finite and greater than zero.
Error in ==> e:\matlab5\nightly\toolbox\matlab\graph2d\zoom.m
On line 217 ==> set(ax,'CameraViewAngle',ncva);
I cannot find a way to zoom out of my 3-D plot.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ZOOM function works on 3-D plots, but requires that you use the functional form of ZOOM to zoom in and out. In general, if you zoom in by a factor of X, you can zoom back out using 1/X.
For example:
zoom(.5)
to reverse the results, use:
zoom(2)
Negative numbers (for example, -2) are not valid zoom factors.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!