How can I efficiently plot a large amount of graphs stacked in a scrollable manner within a panel?
29 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 14 Set 2020
Risposto: MathWorks Support Team
il 14 Set 2020
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?
Risposta accettata
MathWorks Support Team
il 14 Set 2020
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
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Develop uifigure-Based Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!