Centering multiline text with the LaTeX interpreter

7 visualizaciones (últimos 30 días)
Juliette Salexa
Juliette Salexa el 28 de Ag. de 2012
To get two-line text on a figure I have to do:
uicontrol('Style','text','Position',[14, -1000,0], 'String',{'line 1','Longer line 2'});
However, if I want the strings to be interpreted by LaTeX, I'd first try:
uicontrol('Style','text','Position',[14, -1000,0], 'String',{'line 1','Longer line 2'}, 'HorizontalAlignment', 'left', 'Interpreter','Latex','FontSize',36);
But the MATLAB doesn't like the interpreter command.
But
text(14, -1000, {'\makebox[4in][c]{text}','\makebox[4in][c]{longer text}'}, 'HorizontalAlignment', 'left', 'Interpreter','Latex','FontSize',36);
Does not produce any text on the figure !
Does anyone know how to get 2 lines of centered text on a figure while being interpreted by LaTeX ?

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de Ag. de 2012
When that command is given by itself, the position (14,-1000) is outside of the graph limits, so nothing shows up.
If you change to (0,0) for testing purposes, then further experimentation shows that the graph will show up if you change to (e.g.) 4cm rather than 4in .

Categorías

Más información sobre Printing and Saving 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