Two-line y-label with Latex interpreter not centred properly

조회 수: 13 (최근 30일)
Susan Sun
Susan Sun 2017년 12월 3일
댓글: Star Strider 2017년 12월 4일
Hi,
I'd like to make a 2-line y-label in Latex but centred properly. When I try
%
figure
plot(0:10,0:10)
ylabel({'line 1 of label','line 2 (Suppose I want just \emph{THIS} italicized)'},'interpreter','latex')
%
I get the top plot in the attached screenprint, where the centering is wrong.
I also tried
%
figure
plot(0:10,0:10)
ylabel({'line 1 of label','line 2 (Suppose I want just THIS italicized)'})
%
and it centres properly, but then I can't selectively italicize the symbol I want - it's all or nothing.
I'm sorry if this is a really dumb question - I would've thought there'd already be an answer, but I can't for the life of me find one.
Thanks for your help!

채택된 답변

Star Strider
Star Strider 2017년 12월 3일
This works for me (in R2017b):
figure
plot(0:10,0:10)
ylabel({'line 1 of label','line 2 (Suppose I want just \it{THIS} italicized)'}, 'interpreter','latex')
  댓글 수: 2
Susan Sun
Susan Sun 2017년 12월 4일
Hahaha, if in doubt, update! I feel very silly now but also happy. Thank you so much!
Star Strider
Star Strider 2017년 12월 4일
As always, my pleasure!
Have fun!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by