The function zoomOrientation reduces width and height of an axes and adds two new axes, xOrientation and yOrientation plus xSlider and ySlider. You can either use the mouse wheel to zoom in/out or the mouse buttons left-click for zoom in and right-click for zoom out or the keys arrow up/down. Use the sliders to move the zoom area in x/y direction related to the plot data full view. The function uses only those plot data whose visibility is set to on. If no line handle
is visible, it makes the last added plot data visible.
Supports the following Line Plots: plot, semilogx, semilogy, loglog
axh = axes handle
state = on/off/update
Examples how to use zoomOrientation:
If zoomOrientation is already on and the plot data of the main axes has changed, update zoomOrientation with
Close function and restore original axes settings
If axes parent is a figure or uipanel, zooming on xOrientation and yOrientation
axes is still possible, although their properties HitTest and PickableParts are
set to off/none. Works fine with a uitab parent object!
see bottom of the page
Inspired by Yair Altman's scrollplot function.
Sebastian Roehn (2022). zoomOrientation(axh,state) (https://www.mathworks.com/matlabcentral/fileexchange/55969-zoomorientation-axh-state), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired by: ScrollPlot - scrollable X/Y axes
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!