MATLAB Answers

How can I write different subscription font type of label?

3 views (last 30 days)
JunYoung Noh
JunYoung Noh on 19 Dec 2019
Edited: Walter Roberson on 20 Dec 2019
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?

  0 Comments

Sign in to comment.

Accepted Answer

Lucademicus
Lucademicus on 19 Dec 2019
Edited: Lucademicus on 20 Dec 2019
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 Comments

Lucademicus
Lucademicus on 20 Dec 2019
I've editted my answer and included screenshots. Lowercase \phi is italic.

Sign in to comment.

Sign in to answer this question.

Tags