- Drag a panel component from the Component Library onto your canvas.
- Set the AutoResizeChildren property of the panel to 'off'.
- Specify the panel as the parent container using the 'Parent' name-value argument when you call subplot. Also, specify an output argument to store the axes.
- Call the plotting function with the axes as the first input argument.
Subplot in Matlab Appdesigner
140 views (last 30 days)
Show older comments
Unfortunately I have gone through mane documentations and question answers but I coudn't find a clear soulution of subplot in matlab app designer. I want to plot this in -- app.UIAxes2
Please help me with this. I am giving my code down below.
subplot(311);
plot(days,cral,days,crbl,'--');
title('Effective contact/transmission rate');
legend('After lockdown', 'Before Lockdown');
subplot(313);
plot(days,TNI,days,TNIwl,'--');
title('Comparison of Total infecteds');
legend('Lockdown', 'Without Lockdown');
subplot(312);
plot(days,I,days,Iwl,'--');
title('Comparison of I');
legend('Lockdown', 'Without Lockdown');
The graph I get from matlab is given below
0 Comments
Answers (1)
Cris LaPierre
on 20 Jul 2021
The specific text that applies is as follows:
For example, the subplot function does not support automatic resizing. To use this function in your app:
app.Panel.AutoResizeChildren = 'off';
ax1 = subplot(1,2,1,'Parent',app.Panel);
ax2 = subplot(1,2,2,'Parent',app.Panel);
plot(ax1,[1 2 3 4])
plot(ax2,[10 9 4 7])
0 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!