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?

 채택된 답변

Star Strider
Star Strider 2016년 2월 18일

4 개 추천

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

Hasib Rahman
Hasib Rahman 2016년 2월 18일
Thanks Strider. It helps me alot!
Star Strider
Star Strider 2016년 2월 18일
My pleasure!
Deke Cisco
Deke Cisco 2024년 7월 20일
편집: Deke Cisco 2024년 7월 20일
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!

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Chad Greene
Chad Greene 2016년 2월 18일

1 개 추천

Try this:
title(' $\varepsilon_{21}$ ','interpreter','latex')

댓글 수: 2

Ah, you said legend. There's an extra step for legends:
l = legend('$\varepsilon_{21}$');
set(l,'interpreter','latex')
Hasib Rahman
Hasib Rahman 2016년 2월 18일
Thanks Chad. It also works!

댓글을 달려면 로그인하십시오.

Maria Erans Moreno
Maria Erans Moreno 2019년 8월 21일

0 개 추천

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

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')

댓글을 달려면 로그인하십시오.

카테고리

질문:

2016년 2월 18일

편집:

2024년 7월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by