- http://www.mathworks.com/matlabcentral/fileexchange/42137-fixxticklabels-automatically-convert-xticklabels-to-multiple-line-format
- http://www.mathworks.com/matlabcentral/fileexchange/27010-pilabels (not exactly what you need, but a demonstration how to insert Pi in the ticks)
- http://www.mathworks.com/matlabcentral/fileexchange/23841-format-tick-labels-extended
- http://www.mathworks.com/matlabcentral/fileexchange/15986-format-tick-labels
How can I add subscripts, superscripts or Greek characters to my tick labels?
22 views (last 30 days)
Show older comments
Hello,
*How do you write Greek characters in XTickLabel?
*How do you subscript and superscript Greek characters in XTickLabel?
0 Comments
Answers (1)
Jan
on 17 Jul 2013
Edited: Jan
on 17 Jul 2013
You find a lot of solutions in the FileExchange, e.g.:
Btw, it is recommended to search in the internet and especially the FEX before posting a question. You find many ready solutions there and save the time for typing the question and waiting for the answers.
3 Comments
Susav Pradhan
on 7 Aug 2020
hi what is the answer...for ticklabels. Even for me
xticklabels({'\alpha','\beta'})
Does not work?
Walter Roberson
on 7 Aug 2020
xticklabels({'\alpha','\beta'})
should work on any release new enough to have xticklabels(), which is R2016b or newer.
However, for it to work,
ax = gca;
ax.TickLabelInterpreter
must be 'tex' (which is the default.) In particular if TickLabelInterpreter is 'latex' then you would need
xticklabels({'$\alpha$','$\beta$'})
It is also possible to set the TickLabelInterpreter differently for each axes:
ax = gca;
ax.XRuler.TickLabelInterpreter = 'tex';
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!