How to write _ in a plot legend?
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/509107/image.png)
i want to 'a_b' in legend .......
How to write ??
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 4 Feb. 2021
Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
Weitere Antworten (2)
weikang zhao
am 4 Feb. 2021
- change the Interpreter like other answers
- Tex has its own escape for _ :
legend('a\_b');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!