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

13 visualizaciones (últimos 30 días)
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!

Respuesta aceptada

Star Strider
Star Strider el 3 de Dic. de 2017
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 comentarios
Susan Sun
Susan Sun el 4 de Dic. de 2017
Hahaha, if in doubt, update! I feel very silly now but also happy. Thank you so much!
Star Strider
Star Strider el 4 de Dic. de 2017
As always, my pleasure!
Have fun!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Bar Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by