Successive boxplots + title issue

13 visualizaciones (últimos 30 días)
Bernard
Bernard el 25 de Feb. de 2019
Comentada: Bernard el 6 de Dic. de 2019
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 comentario
ANKUR KUMAR
ANKUR KUMAR el 25 de Feb. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Matthew
Matthew el 3 de Dic. de 2019
Editada: Matthew el 3 de Dic. de 2019
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(...)
  1 comentario
Bernard
Bernard el 6 de Dic. de 2019
I second the temp fix, that's what I did as well for lack of a better solution!
It seems the bug is gone in 2019b Update 2

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by