Disabling printing underscore as subscript in figures

619 ビュー (過去 30 日間)
AP
AP 2011 年 6 月 11 日
コメント済み: Eliot 2025 年 4 月 16 日
Underscores print as subscript in figures. Can I disable it because I want to print the underscores as well.
Thanks.
  2 件のコメント
Michael Marcus
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
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.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2011 年 6 月 11 日
編集済み: Image Analyst 2018 年 1 月 17 日
Set the Interpreter property for that field to 'none'; the default for text() fields is LaTex.
title('This_title has an underline', 'Interpreter', 'none'); % Also works with xlabel() and ylabel()
  13 件のコメント
Yulong Li
Yulong Li 2023 年 5 月 9 日
@Walter Roberson got it, thanks!
Eliot
Eliot 2025 年 4 月 16 日
Thank you for this easy solution to my messed-up plot titles!

サインインしてコメントする。

その他の回答 (1 件)

HE
HE 2020 年 5 月 5 日
If you are using sprintf, \\_ should work for you.
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);

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by