How to use scrollable subplots in a tabbed panel? (function scrollsubplot)
6 ビュー (過去 30 日間)
古いコメントを表示
I want to display all my calculation results in one figure window with tabbed panels.
As I would like to show multiple subplots in one tab, I started using the FileExchange function "scrollsubplot" (https://de.mathworks.com/matlabcentral/fileexchange/7730-scrollsubplot) , which seems to work fine for using subplots in an figure without tabs, but when trying to run it inside a tab panel, an error occurs.
Here is the code I use for creating simple standard subplots in a tabbed panel (which works fine, but is highly unconfortable for many subplots):
f = figure();
tab1 = uitab();
ax1 = axes('Parent', tab1);
x= linspace(-1, 1, 20);
y=x;
subplot(2,2,1);
plot(x, y);
And here ist the Code which uses the function "scrollsubplot" and displays an error:
f = figure();
tab1 = uitab();
ax1 = axes('Parent', tab1);
x= linspace(-1, 1, 20);
y=x;
scrollsubplot(2,2,1); %The only change
plot(x, y);
The Error says:
" Error using / Matrix dimensions must agree.
Error in scrollsubplot (line 247) 'sliderstep',[1/nrows 1]/(1/((nrows)/max(1,1+maxrownr(:)-minrownr(:)-nrows)))) " .
I appreciate every help and am thankful for every clue!
0 件のコメント
採用された回答
Bob Blaine
2017 年 7 月 21 日
Hi Sven,
I was able to get this to work by making a small change to your code:
f = figure();
tab1 = uitab();
x= linspace(-1, 1, 20);
y=x;
ax = scrollsubplot(2,2,1);
ax.Parent = tab1;
plot(x,y)
I'm not familiar with scroll subplot, but it looks like it wants to create its own axes, which you can then parent to the tab.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!