How to write _ in a plot legend?

48 vues (au cours des 30 derniers jours)
도현 김
도현 김 le 4 Fév 2021
Commenté : 도현 김 le 4 Fév 2021
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
i want to 'a_b' in legend .......
How to write ??

Réponse acceptée

Cris LaPierre
Cris LaPierre le 4 Fév 2021
Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
  1 commentaire
도현 김
도현 김 le 4 Fév 2021
very very very very very very very very very Thank you !!!!
happy new year ~!~!

Connectez-vous pour commenter.

Plus de réponses (2)

Walter Roberson
Walter Roberson le 4 Fév 2021
legend(xxx, 'interpreter', 'none')
  1 commentaire
도현 김
도현 김 le 4 Fév 2021
thanks ! ! :)

Connectez-vous pour commenter.


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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by