I have a loop that that runs an analysis and plots data on a 1 by 3 subplot figure.
At the end of each loop, a dialog box offers the option to either "Continue", or "Continue & Save". In either case, the next iteration begins using new data, and a new subplot is generated. If only "Continue" is selected, the code works perfectly everytime in each subsequent iteration.
However, if "Save & Continue" is selected, the figure is saved as expected, but every subsequent iteration fails to generate the correct subplot (only the first of the three subplots are generated, and the remaining space is blank).
if strcmpi(response, 'Continue & Save')
Above is the small conditional loop that is entered if "Continue & Save" is selected. If only "Continue" is selected, no extra code is required as it is simply at the end of the loop and therefore the next iteration begins automatically.
I apologise for not attaching some reproducible code, but it is important to note that the subplots are correctly generated if only "Continue" is selected.
Furthermore, I have cleared the figures and even closed the windows between each iteration to attempt to detach any over-hanging effects, yet the problem still persists.
If anyone has any advice for how to fix this issue I would be very grateful.
My appreciation in advance for my first posted question,
To summarise: saveas changes the behaviour of subplot in a loop