Matlab AppDesigner: Subplots in a panel disappear

4 views (last 30 days)
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.

Answers (1)

Avni Agrawal
Avni Agrawal on 23 Jul 2024
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.

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!