Disabling printing underscore as subscript in figures
显示 更早的评论
Underscores print as subscript in figures. Can I disable it because I want to print the underscores as well.
Thanks.
2 个评论
Michael Marcus
2019-4-11
编辑:Stephen23
2019-4-11
Although this allows underscores to print, it does not allow special symbols such as \mum to work.. Does anyone know how to allow both.
Mike Marcus
Michael Marcus
2019-4-11
I did find out another way to keep the underscore. \_ does work ? I have answered my own question? Convert all underscores in the text to \_ instead of changing the interpreter to none.
采纳的回答
更多回答(1 个)
HE
2020-5-5
If you are using sprintf, \\_ should work for you.
Example from https://www.mathworks.com/matlabcentral/answers/94238-how-can-i-place-the-_-or-characters-in-a-text-command#comment_327816:
old_cells = sprintf('Old cells: Y = %3.3f (X) \\^ %1.3f',coefs_old);
young_cells = sprintf('Young cells: Y = %3.3f (X) \\^%1.3f',coefs_young);
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!