Centering multiline text with the LaTeX interpreter
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
I tried the suggestion of Doug Schwarz in http://www.mathworks.com/matlabcentral/newsreader/view_thread/279458
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 ?
0 Kommentare
Antworten (1)
Walter Roberson
am 28 Aug. 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 .
0 Kommentare
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!