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

H
himanshusingh91 · Aug 6, 2020 · 2.4K views
Question
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.
Expert Answer
Profile picture of John Michell
John Michell PhD Expert
Answered Aug 24, 2026
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.

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!