Plot graph not shown
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I am currently using 'stackedplot' to plot all of my data (unfortunately I cannot change this to non-stacked plot due to iternative solutions) and due to number of plots, figure can't show all plots.

But I do need to show all the plots somehow.
I tried to use uipanel to adjust the side and made it scrollable but it wasn't still showing all plots.
Is there a way to adjust so that I can scroll to see all plots (variables?)
or alternative way to adjust by deselecting the plots like the 'plot browser'.
Here is the code I use.
figure (1)
penel1 = uipanel('parent',1);
panel2 = uipanel('Parent',penel1);
set(penel1,'Position',[0 0 1 1]);
set(panel2,'Position',[0 -1.8 1 3]);
set(gca,'Parent',panel2);
%figure data info
stackedplot(figure data info); % replace your stack plot fucntion here
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])
end
0 件のコメント
回答 (1 件)
Taylor
2024 年 1 月 9 日
I would recommend tiledlayout instead. stackedplot seems to be dynamically resizing your plots, tiledlayout does not do this. Of course the individual x-axes are not handled quite as nicely as they are in stackedplot, but you can make those edits yourself (https://www.mathworks.com/help/matlab/ref/matlab.graphics.axis.axes-properties.html).
3 件のコメント
Taylor
2024 年 1 月 10 日
You won't need the uipanel/uicontrol/slider with tiledlayout because it is not dynamically sized. Play around with nRows in the code below and you'll see that even if you set it to a larger number like 50 all of the plots are still visible in the same window. How legible they are is a different question.
nRows = 15;
data = rand([nRows 10]);
f1 = figure;
tiledlayout(f1, nRows, 1)
for ii = 1:nRows
nexttile
plot(data(ii,:))
end
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!