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 日

2 投票

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 日

0 投票

legend(xxx, 'interpreter', 'none')
weikang zhao
weikang zhao 2021 年 2 月 4 日

0 投票

  1. change the Interpreter like other answers
  2. Tex has its own escape for _ :
legend('a\_b');

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by