Rank: 1636 based on 46 downloads (last 30 days) and 1 file submitted
photo

Emile Demarteau

E-mail
Lat/Long
51.44699, 5.48882

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Emile
Updated   File Tags Downloads
(last 30 days)
Comments Rating
26 Nov 2009 Screenshot Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau latex, export, documents, laprint, print 46 8
  • 5.0
5.0 | 1 rating
Comments and Ratings by Emile View all
Updated File Comments Rating
07 Jul 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau

Hi Pascal,

I had a similar problem. Matlabs legend command does not really have correct positioning properties if the legend is outside the figure. I added some lines below the legend2latex function to adjust the position properties manually

legend2latex(fig1);
legendstr_h = findobj(gca,'Tag', 'legend2latex_text');
xlim_ax1 = get(gca,'XLim'); ylim_ax1 = get(gca,'YLim');
set(legendstr_h, 'Position', [min(xlim_ax1)+1.7*range(xlim_ax1), 1.0125*max(ylim_ax1) 0]);

hope this helps.
Cheers, Emile

28 Oct 2009 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau

Hi Diane,

See below for an example of how this file can be used. I noted that the figure_handle is different from the figure_handle as expected by LaPrint. I use a direct handle, where LaPrint uses the figure number.

Good luck,
Emile

%%%%% EXAMPLE %%%%%%
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');

30 Sep 2009 LaPrint LaPrint prints a MATLAB figure to file for neat inclusion in LaTeX documents. Author: Arno Linnemann

Great work! This script allowed me to perfectly markup all my figures, so they could be included nicely in my report. @Tor Aksel, I wrote a legend to latex converter to overcome the small box problem.

30 Sep 2009 LaPrint LaPrint prints a MATLAB figure to file for neat inclusion in LaTeX documents. Author: Arno Linnemann

10 Feb 2009 plot arrowhead Simple and SMALL code for arrowhead plot. Author: Ohad Gal

This is the function I was looking for. Great work. Makes plotting arrows a piece of cake.

Thanks for sharing

Comments and Ratings on Emile's Files View all
Updated File Comment by Comments Rating
20 Jul 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau David

This solution works perfectly for me combined with laprint, but whenever I include legend2latex i lose the marker information stored within the legend.

For reference this is what I am using,

util1 = figure;
plot(sense_times, ut, '-*b', 'LineWidth', 1);
hold on;
plot(sense_times, ut_g, '-or', 'LineWidth', 1);
legend1 = legend('Local Util.', 'Global Util.', 'Location', 'SouthEast');
%set(legend1, 'Box', 'off');
%set(legend1, 'Color', 'none')
xlabel('Sensed Frequencies');
ylabel('Utilization');
title('Frequency Utilization (PU Activity = 0.2)');
grid on;
figfontsizes(11,9);
legend2latex(util1);
% legendstr_h = findobj(gca,'Tag', 'legend2latex_text');
% xlim_ax1 = get(gca,'XLim'); ylim_ax1 = get(gca,'YLim');
% set(legendstr_h, 'Position', [min(xlim_ax1)+1.7*range(xlim_ax1), 1.0125*max(ylim_ax1) 0]);
laprint(gcf,'util1','width',11,...
'asonscreen','off','keepfontprops','off',...
'factor',1,'scalefonts','off','mathticklabels','on');

07 Jul 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Demarteau, Emile

Hi Pascal,

I had a similar problem. Matlabs legend command does not really have correct positioning properties if the legend is outside the figure. I added some lines below the legend2latex function to adjust the position properties manually

legend2latex(fig1);
legendstr_h = findobj(gca,'Tag', 'legend2latex_text');
xlim_ax1 = get(gca,'XLim'); ylim_ax1 = get(gca,'YLim');
set(legendstr_h, 'Position', [min(xlim_ax1)+1.7*range(xlim_ax1), 1.0125*max(ylim_ax1) 0]);

hope this helps.
Cheers, Emile

23 Jun 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau SZACHERSKI, Pascal

Hello Emile,

is the any possibility of locating the legend elsewhere? Just like in the legend command " ..., 'Location', 'EastOutside' ..." etc.? Would be a great help.
Thanks for sharing your script by the way!

06 May 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Marco

Unfortunately, the function does not work for me on histograms, I assume to all similar functions. Is it possible to extend this? Does this only have to do with the fact that it can not find appropriate line styles/markers in this case?

22 Mar 2010 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau Dylan

Works like a charm. For those who want to use this with plotepstex (and plot2eps):

In the plotepstex.m file:

Comment out the legend-handling code at lines 104-125 and lines 154-173.

Then add the following lines at line 147:

if ~isempty(legend)
    legend2latex(h)
end

Top Tags Applied by Emile
documents, export, laprint, latex, print
Files Tagged by Emile
Updated   File Tags Downloads
(last 30 days)
Comments Rating
26 Nov 2009 Screenshot Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau latex, export, documents, laprint, print 46 8
  • 5.0
5.0 | 1 rating

Contact us at files@mathworks.com