"\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 π.
12 views (last 30 days)
Show older comments
Nishan Pokhrel
on 22 Nov 2022
Answered: Steven Lord
on 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 Comments
Accepted Answer
Steven Lord
on 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 Comments
More Answers (0)
See Also
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!