zoomOrientation(axh​,state)

版本 1.1.0.0 (24.9 KB) 作者: Sebastian Roehn
Scroll a zoomed axes in x/y direction related to full view
397.0 次下载
更新时间 2016/3/15

查看许可证

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

Function Inputs:
axh = axes handle
state = on/off/update

Examples how to use zoomOrientation:
>> figure(1)
>> plot(1:100,randn(1,100))
>> zoomOrientation(gca,'on')

If zoomOrientation is already on and the plot data of the main axes has changed, update zoomOrientation with
>> zoomOrientation(gca,'update')

Close function and restore original axes settings
>> zoomOrientation(gca,'off')

Known issues:
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!

Changelog:
see bottom of the page

Inspired by Yair Altman's scrollplot function.

引用格式

Sebastian Roehn (2024). zoomOrientation(axh,state) (https://www.mathworks.com/matlabcentral/fileexchange/55969-zoomorientation-axh-state), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Visual Exploration 的更多信息
致谢

参考作品: ScrollPlot - scrollable X/Y axes

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Changelog v1.1:
- disabled initial zoom factor
- bugfix if function was called with state off or update but the function was not started before
- use plot data only whose visibility is set to on

1.0.0.0

add screenshot
Update description