How to write _ in a plot legend?

45 visualizaciones (últimos 30 días)
도현 김
도현 김 el 4 de Feb. de 2021
Comentada: 도현 김 el 4 de Feb. de 2021
xxx = {'a_b'}
plot(1:5)
legend(xxx)
>> result is
i want to 'a_b' in legend .......
How to write ??

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (2)

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

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by