How to add subscript in xticklabels?

I have used code like
xticklabels({'SA(MO)$_{2}$H','RSMOH','MODA'})
in which 2 should be subscript of (MO), but failed. Can you please help me? Thanks!

回答 (1 件)

Star Strider
Star Strider 2021 年 11 月 9 日

0 投票

Try something like this —
figure
Ax = axes;
plot(Ax, 0:2, randn(1,3))
xticks(0:2)
xticklabels({'SA(MO)$_{2}$H','RSMOH','MODA'})
Ax.TickLabelInterpreter = 'latex';
.

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

SM
2021 年 11 月 9 日

回答済み:

2021 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by