It's a little curious, your syntax seems alright. Have you screwed up some fonts of your system? Or maybe your 'interpreter'
is set to none
(doc text props)?
Check it with (hx
= handle of xlabel):
get(hx, 'Interpreter')
and set it with:
set(hx, 'Interpreter', 'tex')
If that is not working, as a first workaround you could try to activate the Latex interpreter instead of the usually default tex
.
x = 0:40;
y = x.^2;
plot(y,x, 'x')
title('alpha eta gamma');
hx = xlabel('Symbol $sqrt{Delta}$ ','interpreter','latex');
hy = ylabel('Symbol $sqrt{epsilon}$','interpreter','latex');
But actually for simple greek letters, that is not necessary!
with the default tex
interpreter:
hx = xlabel('Delta');
hy = ylabel('epsilon');
is working too:
but used with latex syntax delta
is not recognized anymore:
xlabel('Symbol $sqrt{Delta}$ ','interpreter','tex');
ylabel('Symbol $sqrt{epsilon}$','interpreter','tex');
Other ideas:
What font does it return when you type: get(0,'DefaultAxesFontName')
?
Does it work when you set it to Helvetica or Arial?
set(0,'DefaultAxesFontName','Helvetica');
It is also reported that on some systems (e.g. Ubuntu 12.xx) you need to install tex fonts first.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…