How to use scrollable subplots in a tabbed panel? (function scrollsubplot)
4 次查看(过去 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!