"\newline" "\mu" "pi", etc. doesn't work as intended on xticklabel of boxplot. It just prints as it is instead of printing a new line or μ or π.
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nishan Pokhrel
am 22 Nov. 2022
Beantwortet: Steven Lord
am 22 Nov. 2022
Using the above commands doesn't work as intended on xticklabel for boxplot, but works normally for xticklabel for normal plot, or for xlabel or ylabel of normal plot or boxplot. It is just the xticklabel of boxplot that the above commands doesn't work.
For example, having xticklabel(a \mu b), simply prints "a \mu b", instead of "a μ b".
Don't know what's going on. Is this a bug that needs to be reported?
Please help.
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 22 Nov. 2022
Note that in order for tick labels to be interpreted as TeX or LaTeX the TickLabelInterpreter property needs to be set correctly. The default is 'TeX'. If the TickLabelInterpreter is set to 'none' (which I believe the boxplot function does in case the variables you're trying to plot have names that include characters like underscore) the tick labels won't be interpreted.
figure
load carsmall
boxplot(MPG, Origin)
xticklabels('a \mu b')
ax = gca;
ax.XAxis.TickLabelInterpreter
If I create a boxplot and change that property see what happens:
figure
load carsmall
boxplot(MPG, Origin)
xticklabels('a \mu b')
ax = gca;
ax.XAxis.TickLabelInterpreter = 'TeX';
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Labels and Annotations 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!