MATLAB: Does the LaTeX interpreter not turn off in the legend when the “DefaultTextInterpreter” is “none”

MATLAB

When I run the following code:
set(0, 'DefaultTextInterpreter','none')
figure; plot(1:10)
l = legend('test_line');
my LATEX interpreter is not turned off in my legend.

Best Answer

Legend has its own "Interpreter" property that controls the interpreter for the text labels.
Prior to MATLAB R2014b, there is no default legend interpreter property that can be set.
The solution is to do the following:
set(0,'DefaultTextInterpreter','none') % for setting text interpreter to 'none'
figure; plot(1:10)
l = legend({'test_line'},'Interpreter','none') % this has to be done for each call to a new legend
MATLAB R2014b onwards there is a default legend interpreter property called "DefaultLegendInterpreter", which can be set to "none" as follows:
set(groot, 'DefaultLegendInterpreter', 'none')