Using epsilon in legend

111 visualizaciones (últimos 30 días)
Hasib Rahman
Hasib Rahman el 18 de Feb. de 2016
Editada: Deke Cisco el 20 de Jul. de 2024
I want to use Greek symbol epsilon "ɛ" in my legend and I use \epsilon. But it gives me "є" . I found a solution using char(949). But I can not use subscript with that. Actually I need to write "ɛ_21". Can anyone please help me?

Respuesta aceptada

Star Strider
Star Strider el 18 de Feb. de 2016
You just need to concatenate the special character with the subscript, and it works (at least in R2015b):
figure(1)
plot(1:10, rand(1,10))
legend([char(949) '_{21}'])
  3 comentarios
Star Strider
Star Strider el 18 de Feb. de 2016
My pleasure!
Deke Cisco
Deke Cisco el 20 de Jul. de 2024
Editada: Deke Cisco el 20 de Jul. de 2024
What if you what \varepsilon in the middle of a title? is that possible? Something like this?
title('\sigma_{longitudinal} - '[char(949) '_{longitudinal}'],'FontSize',14)
I'm not a fan of using 'Intepreter','LaTex' because it changes the font, so I'm curious if there is another way. Thank you!

Iniciar sesión para comentar.

Más respuestas (2)

Chad Greene
Chad Greene el 18 de Feb. de 2016
Try this:
title(' $\varepsilon_{21}$ ','interpreter','latex')
  2 comentarios
Chad Greene
Chad Greene el 18 de Feb. de 2016
Ah, you said legend. There's an extra step for legends:
l = legend('$\varepsilon_{21}$');
set(l,'interpreter','latex')
Hasib Rahman
Hasib Rahman el 18 de Feb. de 2016
Thanks Chad. It also works!

Iniciar sesión para comentar.


Maria Erans Moreno
Maria Erans Moreno el 21 de Ag. de 2019
I have a new question in this topic I need to put ɛ' and ɛ'' in two different graphs
I have tried [char(949) ' ' '] or [char(949) ' " ']
I have also tried with \varepsilon but it does not seem to work. Can somebody help me?
  1 comentario
ztjona
ztjona el 26 de Mayo de 2022
You just change the interpreter to latex in any function you need (like title, ylabel, legend, etc.) and you can use both epsilons variations.
plot(rand(100, 1))
title('$\epsilon$ and $\varepsilon$', 'Interpreter','latex')

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by