using $\textit{w}$ in legend

I have an existing figure that I want to use this term $\textit{w} = 0$ in its legend. I'm setting the latex interpreter using set(findall(gcf,'defaulttextInterpreter','latex ')) but I keep getting this error Warning: Unable to interpret TeX string "$\textit{w}$ = 1,k=1" any help would be appreciated.

 Respuesta aceptada

Matt J
Matt J el 16 de En. de 2018

0 votos

Try setting the interpreter directly,
set( legend('$\textit{w}$ = 1,k=1') , 'Interpreter','latex');

3 comentarios

Matt J
Matt J el 16 de En. de 2018
Alternatively,
set(findall(gcf,'Interpreter','tex'),'Interpreter','latex ')
Matt J
Matt J el 16 de En. de 2018
Diana's comment moved here:
Thanks.
Matt J
Matt J el 16 de En. de 2018
You're welcome.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 16 de En. de 2018

Comentada:

el 16 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by