Successive boxplots + title issue
Show older comments
Hi all,
I'm successively boxplotting 5 numerical arrays whose dimensions are approximately 50*20
My code doesn't use for loops, it simply boxplots the arrays one after another using the same code
figure
boxplot(array1);
title('Title for figure 1');
xticklabels({'some' 'cell' 'array' 'etc' 'etc' 'up' 'to' '20' 'values'});
xlabel('The X label');
ylabel('The Y label');
grid on
figure
boxplot(array2);
% ...
figure
boxplot(array5);
% ...
The script then bar- or scatter plots 7 other arrays, also adding titles and axis labels. I end up with 12 figures open.
Problem is, boxplot titles are sometimes mixed up between figures, or simply don't appear. Usually, the last boxplot title doesn't appear.
When I add pauses between each figure, or debug my code line by line, the issue doesn't occur.
Behavior verified in both 2018a and 2018b (update 3 applied)
1 Comment
ANKUR KUMAR
on 25 Feb 2019
What's the size of array1? Is it 50*20?
Please attach your data and expand you question, so that we can help you in a bit more effective manner.
Answers (1)
I'm having this problem as well, and seems like a Matlab bug (2018b). I have a for loop over 5 plots, and it seems to omit the title of one random plot out of the 5. Very strange behavior.
TEMPORARY FIX: insert pause(1) after each call to boxplot(...)
Categories
Find more on 2-D and 3-D Plots 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!