How can I write different subscription font type of label?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
JunYoung Noh
le 19 Déc 2019
Commenté : Patrick Laux
le 16 Juil 2020
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 commentaires
Réponse acceptée
Lucademicus
le 19 Déc 2019
Modifié(e) : Lucademicus
le 20 Déc 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}')
If you want a longer subscript, you should place that subscript also within curly brackets:
xlabel('\phi_{D_{solid}}')
2 commentaires
Lucademicus
le 20 Déc 2019
I've editted my answer and included screenshots. Lowercase \phi is italic.
Plus de réponses (2)
Patrick Laux
le 16 Juil 2020
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}'})
1 commentaire
Patrick Laux
le 16 Juil 2020
ah okay, I found it:
you have to specifiy latex interpreter
set(gca,'TickLabelInterpreter', 'tex');
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!