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?

回答(1 个)

Jan
Jan 2013-7-17
编辑:Jan 2013-7-17
You find a lot of solutions in the FileExchange, e.g.:
Simply search for "tick label" in the FileExchange for much more solutions.
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
Susav Pradhan 2020-8-7
hi what is the answer...for ticklabels. Even for me
xticklabels({'\alpha','\beta'})
Does not work?
Walter Roberson
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 CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by