Matlab AppDesigner: Subplots in a panel disappear
4 次查看(过去 30 天)
显示 更早的评论
I want to plot > 10 subplots in a scrollable panel. When I change the OuterPosition, not all subplots will be plotted or are deleted. In the example app, this happens with more than 10 subplots. The positions of the subplots do not overlap. I tried plotting the subplots in reverse order from bottom to top (like in the example app), but that didn't help either.
1 个评论
Divyam
2024-7-22
Check that your plots follow this requirement for properly displaying components using the "scrollable" property: https://www.mathworks.com/help/matlab/ref/matlab.ui.container.panel-properties.html?s_tid=srchtitle_site_search_3_ability%2520to%2520scroll#mw_c50e0be5-6b7c-4c69-822c-240c176076c4:~:text=Components%20that%20do%20not%20fit%20in%20the%20container%20must%20be%20above%20or%20to%20the%20right%20of%20the%20container.%20You%20cannot%20scroll%20to%20components%20that%20are%20below%20or%20to%20the%20left%20of%20the%20container.
回答(1 个)
Avni Agrawal
2024-7-23
I understand that some subplots are disappearing when the number of subplots exceeds a certain limit. It appears that the code provided has issues correctly calculating and setting the `OuterPosition` of the subplots when the number of subplots (n) is greater than 10. This can often result in subplots overlapping or being positioned outside the visible area.
Consider adjusting the height of the panel or recalculating the outer position accurately. You can also add a warning to check if the subplots are within the height limit:
% Check if the last subplot is within the panel bounds
if hpos > 1 - margin_top
warning('Subplots exceed the available panel height.');
end
I hope this helps.
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!