How to write _ in a plot legend?
71 次查看(过去 30 天)
显示 更早的评论
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
i want to 'a_b' in legend .......
How to write ??
0 个评论
采纳的回答
Cris LaPierre
2021-2-4
Set the interpreter to 'none'
xxx = {'a_b'};
plot(1:5)
legend(xxx,'interpreter','none')
更多回答(2 个)
weikang zhao
2021-2-4
- change the Interpreter like other answers
- Tex has its own escape for _ :
legend('a\_b');
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!