Axes automatically change size and get mis-aligned in App Designer
24 views (last 30 days)
Hello Matlab Community!
Happy New Year! Hope you all have a productive year coding your hearts away to solve important problems!
One of the very few issues I have been having in Matlab recently has been App Designer's automatic adjustment of axes after plotting. I pre-define the size of my axes so that they are aligned in a 2 x 2 matrix fashion. I push a button and all 4 axes are populated with data. Then an automatic size adjustment of the axes occurs. This causes them to not be aligned and look unprofessional, and in some cases, makes it difficult to correlate between axes when they share the same axis min/max values. Is there any simple way to fix this? Is this fixed or is there an option to "freeze" axes dimensions in newer versions? I have also tried using the Grid Layout option, but that did not prevent the automatic size adjustements.
Attached are screen shots before (aligned, as shown in App Designer) and after (misaligned).
Matt Gaidica on 22 Jan 2021
Kris, one thing you can do is get the position property from all axes before you populate the data and then set it again afterwards.
pos = get(AxesHandle,'Position');