Rank: 315931 based on 0 downloads (last 30 days) and 0 file submitted


UC Santa Barbara

Personal Profile:

Physics student in US


Watch this Author's files


Comments and Ratings by Anthony
Updated File Comments Rating
16 Aug 2012 Legend to latex converter This function converts a Matlab legend to a text annotation for latex interpretation. Author: Emile Demarteau

Very nice function! I found another bug - it doesn't place the legend properly for axes that have a log scale. To fix this:

First determine whether the axes have a log or linear scale. I did this with:

axes_handle_var = get(figure_handle,'currentaxes');
x_axis_scale = get(axes_handle_var,'xscale');

If the scale is logarithmic then the code in 'legend2latex.m' around line 239 must be changed to:

legendx = (min(get(plots(1),'XLim')))^(1-legend_percentual_x) * (max(get(plots(1),'XLim')))^(legend_percentual_x);

It would be best to use an 'if' statement to properly place the legend for both scales. Change the 'ylegend' code in a similar way.

Contact us