text in plot with latex interpreter
268 次查看(过去 30 天)
显示 更早的评论
Dear
I would like to write come text in a simple plot using latex codification
The plot is here
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/458655/image.png)
The text in plot is code as follows:
text(x0 ,y0-(i-1)*dy,sprintf('$$c_{[\rho_{e}]_w^m}$$= %.3f',b(i)), ...
'Interpreter', 'latex', ...
'fontsize', 10);
Why dose the subscript of c is not the greek letter rho?
thanks in advance
采纳的回答
Cris LaPierre
2020-12-12
编辑:Cris LaPierre
2020-12-12
Because sprintf interprets '\r' as a carriage return. Use '\\r' instead.
text(.1,.5,sprintf('$$c_{[\\rho_{e}]_w^m}$$= %.3f',18.556), ...
'Interpreter', 'latex', 'fontsize', 10);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!