How can I write different subscription font type of label?

4 次查看(过去 30 天)
Like figure below, I want to write phi and CH4 for diffrent font type.
(phi should be Italic but CH4 should not. & CH4 must be a subscription of phi)
How can i do this?

采纳的回答

Lucademicus
Lucademicus 2019-12-19
编辑:Lucademicus 2019-12-20
You can achieve that by using a underscore _, following what you'd want subscripted. You can group something by placing it within curly brackets.
In this case:
xlabel('\phi_{CH_4}')
phiCH4.png
If you want a longer subscript, you should place that subscript also within curly brackets:
xlabel('\phi_{D_{solid}}')
Dsolid.png

更多回答(2 个)

Walter Roberson
Walter Roberson 2019-12-20
编辑:Walter Roberson 2019-12-20

Patrick Laux
Patrick Laux 2020-7-16
Hi,
interestingly, subscripting does not work in combination with the boxplot function.
Any help appreciated.
A=rand(100,1)
boxplot(A)
set(gca, 'XTickLabel', {'test_{hey}'})

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by