How can I break the text in two or three lines of the x tick label on a box plot?
48 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ifigenia Aslanidou
am 29 Aug. 2021
Kommentiert: dpb
am 30 Aug. 2021
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 Kommentare
Akzeptierte Antwort
dpb
am 29 Aug. 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 Kommentare
dpb
am 30 Aug. 2021
Yes, using text() works ... why TMW neutered the interpreter for the tick labels is anybody's guess.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!