Centering multiline text with the LaTeX interpreter
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2012-8-28
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!