How can I break the text in two or three lines of the x tick label on a box plot?
43 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone! Can anybody help me break the x tick labels in multiple lines?
Each xtick label is actually a really long name so I though it would be better to replaced them with A-K..
I tried using \ or {'A1';'A2'} but it wont work..
boxplot(subjective,'Labels',{'A','B','C','D','E','F','G','H','I','J','K'},...
'PlotStyle','compact','Orientation','vertical', 'BoxStyle','filled','MedianStyle',...
'target', 'Symbol','x','OutlierSize',8);
Thank you in advance!
0 commentaires
Réponse acceptée
dpb
le 29 Août 2021
Unfortunately, the tick label interpreter won't pass a string with embedded \n on; it instead splits the string into two.
I don't think you can do it with either the 'TeX' or 'LaTeX' interpreter with the tick labels; you would have to use text to write the labels independently.
2 commentaires
dpb
le 30 Août 2021
Yes, using text() works ... why TMW neutered the interpreter for the tick labels is anybody's guess.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Axis Labels dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!