How to write _ in a plot legend?

46 ビュー (過去 30 日間)
도현 김
도현 김 2021 年 2 月 4 日
コメント済み: 도현 김 2021 年 2 月 4 日
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
i want to 'a_b' in legend .......
How to write ??

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 2 月 4 日
Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
  1 件のコメント
도현 김
도현 김 2021 年 2 月 4 日
very very very very very very very very very Thank you !!!!
happy new year ~!~!

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

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2021 年 2 月 4 日
legend(xxx, 'interpreter', 'none')
  1 件のコメント
도현 김
도현 김 2021 年 2 月 4 日
thanks ! ! :)

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


weikang zhao
weikang zhao 2021 年 2 月 4 日
  1. change the Interpreter like other answers
  2. Tex has its own escape for _ :
legend('a\_b');

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by