addScrollbar

Add a scrollbar to scroll the x- or y-axis on one or more axes in a figure.
387 Downloads
Updated 16 Oct 2012

View License

Add a scrollbar to control the x- or y-axis on one or more axes. Input 1: axis handle(s), input 2: size of window when scrolling (optional, default is data range in plot divided by 10), input 3: 'x' or 'y' to specify if scrollbar should control the x- or y-axis (optional, default is 'x').

%Example 1: Use a scrollbar to view slices of 100 points of a sine curve at the time
plot(1:1:10000,sin(1:1:10000))
addScrollbar( gca, 100 )
%To scroll the y-axis as well: addScrollbar( gca, 1, 'y' )
Example 2: Scroll/control multiple axes with one scrollbar:
figure;ax(1)=subplot(2,1,1);plot(1:1:10000,sin(1:1:10000));grid on;
ax(2)=subplot(2,1,2);plot(1:1:10000,sin([1:1:10000]+pi/2));grid on;
addScrollbar( ax, 10 )

Cite As

Ivar Eskerud Smith (2024). addScrollbar (https://www.mathworks.com/matlabcentral/fileexchange/38612-addscrollbar), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0