How to add mathematical symbols to text within the legend

89 次查看(过去 30 天)
I'm finding it difficult to add the maths symbol /phi to my actual legend. I am able to add mathematical symbols to the title, but not the legend. I normally plot my data vectors, then edit the name, etc. of them within the plot tools rather than the command line.
I want to be able to state the number 45 followed by /phi (45/phi)

采纳的回答

Kelly Kearney
Kelly Kearney 2013-11-22
The legend command should accept TeX symbols by default, just as titles, x/ylabels, etc:
plot(rand(10,1));
hl = legend('45\phi');
If not, try
set(hl, 'interpreter', 'tex')

更多回答(1 个)

Walter Roberson
Walter Roberson 2013-11-22
Add the option 'Interpreter', 'tex' or 'Interpreter', 'latex', and see http://www.mathworks.co.uk/matlabcentral/answers/14751-greek-alphabet-and-latex-commands-not-a-question

类别

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