Greek letters in axes do not work

I am trying to use Greek letters in my xlabel plot. Every decision on the Internet says that Matlab will accept tex. But instead of a delta symbol, my x axis is simply labeled "D"

a = plot(0:40, y);
hold on

plot(delta_T,brechkraft, 'x')
errorbar(delta_T, brechkraft,delta_b,'x');

title('2mm Oelschicht');


xlabel('\Delta');
ylabel('Brechkraft D in 1/cm');
annotation('textbox', [.2 .8 .1 .1],...
    'String', {'Fit: f(x) = m*x + b',    ['m = ', num2str(p(1)) ],    ['b = ', num2str(p(2)) ]});
shg
hold off

saveas(a, 'abc1.png','png');
+3
source share
1 answer

A little curious, your syntax looks good. Have you messed up some fonts on your system? Or perhaps your 'interpreter'value is set none( doc document details )?

Check this with <<22> = handle from xlabel):

get(hx, 'Interpreter')

and install it with:

set(hx, 'Interpreter', 'tex')

, Latex tex.

x = 0:40;
y = x.^2;

plot(y,x, 'x')
title('\alpha \beta \gamma');

hx = xlabel('Symbol $\sqrt{\Delta}$  ','interpreter','latex');
hy = ylabel('Symbol $\sqrt{\epsilon}$','interpreter','latex');

enter image description here


!

tex:

hx = xlabel('\Delta');
hy = ylabel('\epsilon');

:

enter image description here

delta :

xlabel('Symbol $\sqrt{\Delta}$  ','interpreter','tex');
ylabel('Symbol $\sqrt{\epsilon}$','interpreter','tex');

:

: get(0,'DefaultAxesFontName')? , Helvetica Arial?

set(0,'DefaultAxesFontName','Helvetica');

, (, Ubuntu 12.xx) -.

+13

All Articles