legend command and the Tex interpreter
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Tomy Duby
el 8 de Sept. de 2016
Respondida: Robert
el 8 de Sept. de 2016
How can I prevent the legend command to interpret a string as it were a Tex string? For example, str = 'pdf_ParA'. If I use legend( str ) the letter P is displayed as a subscript.
0 comentarios
Respuesta aceptada
Robert
el 8 de Sept. de 2016
You can use
set(L,'Interpreter','none')
where L is your legend handle or object. You could either return L when you create the legend,
L = legend(...);
or find it with
L = findobj(gcf,'Tag','legend');
Alternatively, if you want other legend entiries to still be interpreted, you can escape the underscores and backslashes in your string with strrep. i.e.,
mystr = strrep(mystr,'\','\\');
mystr = strrep(mystr,'_','\_');
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!