ScrollPlot - scrollable X/Y axes
ScrollPlot adds a scroll sub-window to any supplied plot handles (or current [gca] axes if no handle was supplied). This enables easy plot or image exploration. The user can specify initial view window parameters or use the defaults.
Dragging the side-bars or central patch modifies the parent axes limits interactively. Conversely, modifying the parent axes limits (with zoom, pan or programatically) modifies the corresponding scroll patch(es) accordingly.
Both X & Y scrolling are possible.
Custom properties provide access to the scroll axes, central patch and side-bars, for user customizations (e.g., color, patch opacity level, side-bar line-width, etc.).
ScrollPlot works on Matlab 6 (R12) and up.
Syntax:
scrollHandles = scrollplot(plotHandles, propName,propValue,...)
Examples:
>> scrollplot; % add scroll sub-window to the current axes (gca)
>> scrollplot(plot(xdata,ydata), 'WindowSize',50); % plot with initial zoom
>> scrollplot('Min',20, 'windowsize',70); % add x-scroll to current axes
>> scrollplot([h1,h2], 'axis','xy'); % scroll both X&Y of 2 plot axes
>> scrollplot('axis','xy', 'minx',20, 'miny',10); % separate scroll minima
See extensive help within.
Warning:
This code relies in [small] part on undocumented and unsupported Matlab functionality. It works on Matlab 6+, but use at your own risk!
Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)
Change log:
See the bottom of this webpage
This ScrollPlot was inspired by Steve Lord's scrollplot demo submission, but is an entirely new implementation with lots of new functionality.
Cite As
Yair Altman (2024). ScrollPlot - scrollable X/Y axes (https://www.mathworks.com/matlabcentral/fileexchange/14984-scrollplot-scrollable-x-y-axes), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Graphics > Formatting and Annotation > Labels and Annotations > Annotations >
- MATLAB > Data Import and Analysis > Data Exploration >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > Image Arithmetic >
Tags
Acknowledgements
Inspired by: Scrolling Plot Demo
Inspired: zoomOrientation(axh,state), UISplitPane - Split a container (figure/frame/uipanel) into two resizable sub-containers
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.7.0.0 | Fixed custom properties in HG2 (R2014b+); removed reliance on the unsupported setptr function |
||
1.6.0.0 | Fixed warning about obsolete JavaFrame; preserved figure visibility; fixed zoom/pan compatibility |
||
1.1.0.0 | Support for the upcoming HG2 |
||
1.0.0.0 | Enabled image exploration per suggestion by Joe Lotz; improved log axis-scaling behavior per suggestion by Fredric Moisy; added scroll visibility & deletion handlers; fixed minor error handling bug |