How to add subscript in xticklabels?

조회 수: 3 (최근 30일)
SM
SM 2021년 11월 9일
답변: Star Strider 2021년 11월 9일
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일
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';
.

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by