Code covered by the BSD License  

Highlights from
Legend to latex converter

image thumbnail
from Legend to latex converter by Emile Demarteau
This function converts a Matlab legend to a text annotation for latex interpretation.

sample_latex2pdf.m
%%%%%%%%%%%%%%% EXAMPLE %%%%%%%%%%%%%
%% Example how to use legend2latex %%

set(0,'defaulttextinterpreter','none');
x = [0:0.1:(2*pi)];
fig1 = figure(1);
plot(x,sin(x),x,cos(x));
legend('sin($\theta$)','cos($\theta$)');
xlabel('$0 \leq \theta \leq 2\pi$')
legend2latex(fig1);
laprint(1,'figure1');

Contact us at files@mathworks.com