How can I efficiently plot a large amount of graphs stacked in a scrollable manner within a panel?

I would like to stack a large amount of figures which I can browse through by scrolling within a panel.
How can I efficiently plot a large amount of graphs stacked in a scrollable manner within a panel?

 Accepted Answer

In order to achieve this, firstly create a panel and size it to be tall enough in order to account for the large number of plots needed, and then place that panel in a scrollable container (a uifigure or another panel.). The latter is illustrated with the following example,
numPlots = 75;
pixelHeightPerPlot = 75;
f = uifigure;
f.Scrollable = true;
p = uipanel(f, 'Position',[0 0 f.Position(3)-25 numPlots*pixelHeightPerPlot]);
p.BorderType = 'none';
t = tiledlayout(p, numPlots, 1);
t.Padding = 'none';
for i = 1:numPlots
ax = nexttile(t);
plot(ax,cumsum(randn(50, 1)))
end

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Products

Release

R2020a

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!