Write overrightarrow to letter in plot
8 次查看(过去 30 天)
显示 更早的评论
Hey,
I'm wondering if there is a possibility to write a letter with an overrightarrow as a text annotation to a matlab plot. It should look something like this. With greek letter, integrals the latex commands work but for this one it doesn't. Am I doing something wrong here?
Regards,
Johannes
figure(1)
text(-1,0.2,'\overrightarrow{n}');
0 个评论
采纳的回答
Harsha Priya Daggubati
2020-1-28
Hi,
One issue with the script you have attached is it creates a figure with x and y ticks between 0 and 1, with a difference of 0.1 for each. You are trying to place your text at (-1,0) which is not visible. So, try changing the position of your text.
Secondly, the Interpreter property for text is by default set to Tex, you need to set it to Latex to use ‘overrightarrow’.
Try using the following command:
figure(1)
t = text(0.1,0.2,'\overrightarrow{n}');
set(t,’Interpreter’,’latex’);
Hope this works!
更多回答(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!