"\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 π.
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nishan Pokhrel
le 22 Nov 2022
Réponse apportée : Steven Lord
le 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 commentaires
Réponse acceptée
Steven Lord
le 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 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

