How can I limit zoom to one of the axes of one plot on a figure containing multiple plots?

8 views (last 30 days)
I have a GUIDE-generated figure with two axes. Zooming works well, but I want to limit the zooming to only one of the two axes (subplots), enabling zooming for one of the axes while disabling it for the other axes.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Jun 2012
It is possible to selectively enable or disable zooming for axes using the Zoom Mode Utility Functions.
The setAllowAxesZoom function can be used for this purpose.
For example, the following code generates plots with two axes and enables the zoom only for the first one.
ax1 = subplot(2,1,1);
plot(1:10);
h = zoom;
ax2 = subplot(2,1,2);
plot(rand(3));
setAllowAxesZoom(h,ax2,false);
To learn more about the Zoom Mode Utility Functions, please refer to the documentation page for the ZOOM function. To access the documentation, execute the following at the MATLAB command prompt.
doc zoom

More Answers (0)

Categories

Find more on Visual Exploration 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!