- 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?
20 次查看(过去 30 天)
显示 更早的评论
Hello,
*How do you write Greek characters in XTickLabel?
*How do you subscript and superscript Greek characters in XTickLabel?
0 个评论
回答(1 个)
Jan
2013-7-17
编辑:Jan
2013-7-17
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 个评论
Susav Pradhan
2020-8-7
hi what is the answer...for ticklabels. Even for me
xticklabels({'\alpha','\beta'})
Does not work?
Walter Roberson
2020-8-7
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';
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!