Matlab set defaultTextInterpreter to LaTeX

Posted by Maurits on Stack Overflow See other posts from Stack Overflow or by Maurits
Published on 2012-11-23T20:15:54Z Indexed on 2012/11/23 23:04 UTC
Read the original article Hit count: 224

Filed under:
|

I am running Matlab R2010A on OS X 10.7.5

I have a simple matlab plot and would like to use LaTeX commands in the axis and legend. However setting:

set(0, 'defaultTextInterpreter', 'latex');

Has zero effect, and results in a TeX warning that my tex commands can not be parsed. If I open plot tools of this plot, the default interpreter is set to 'TeX'. Manually setting this to 'LaTeX' obviously fixes this, but I can't do this for hundreds of plots.

Now, if I retrieve the default interpreter via the Matlab prompt, i.e get(0,'DefaultTextInterpreter')

It says 'LaTeX', but again, when I look in the properties of the figure via the plot tools menu, the interpreter remains set to 'TeX'.

Complete plotting code:

figure
f = 'somefile.eps'
set(0, 'defaultTextInterpreter', 'latex'); 
ms = 8;
fontSize = 18;
loglog(p_m_sip, p_fa_sip, 'ko-.', 'LineWidth', 2, 'MarkerSize', ms); hold on;
xlabel('$P_{fa}$', 'fontsize', fontSize);
ylabel('$P_{m}$', 'fontsize', fontSize);
legend('$\textbf{K}_{zz}$', 'Location', 'Best');
set(gca, 'XMinorTick', 'on', 'YMinorTick', 'on', 'YGrid', 'on', 'XGrid', 'on');
print('-depsc2', f);

© Stack Overflow or respective owner

Related posts about matlab

Related posts about plot