Filter löschen
Filter löschen

How to write _ in a plot legend?

25 Ansichten (letzte 30 Tage)
도현 김
도현 김 am 4 Feb. 2021
Kommentiert: 도현 김 am 4 Feb. 2021
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
i want to 'a_b' in legend .......
How to write ??

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 4 Feb. 2021
Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
  1 Kommentar
도현 김
도현 김 am 4 Feb. 2021
very very very very very very very very very Thank you !!!!
happy new year ~!~!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Walter Roberson
Walter Roberson am 4 Feb. 2021
legend(xxx, 'interpreter', 'none')

weikang zhao
weikang zhao am 4 Feb. 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