figure
panel1 = uipanel('Parent',1);
panel2 = uipanel('Parent',panel1);
set(panel1,'Position',[0 0 0.95 1]);
set(panel2,'Position',[0 -1 1 2]);
set(gca,'Parent',panel2);
A=rand(25,1);
B=rand(25,1);
plot(A,B);
s = uicontrol('Style','Slider','Parent',1,...
'Units','normalized','Position',[0.95 0 0.05 1],...
'Value',1,'Callback',{@slider_callback1,panel2});
function slider_callback1(src,eventdata,arg1)
val = get(src,'Value');
set(arg1,'Position',[0 -val 1 2])
1 Comment
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/558370-how-to-generate-a-stacked-plot-with-a-scroll-bar#comment_925325
Direct link to this comment
https://se.mathworks.com/matlabcentral/answers/558370-how-to-generate-a-stacked-plot-with-a-scroll-bar#comment_925325
Sign in to comment.