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

Leo Simon

E-mail
Company/University
U.C. Berkeley

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Leo Simon View all
Updated File Comments Rating
12 Dec 2014 legendflex.m: a more flexible, customizable legend Create a legend with more flexible positioning and labeling capabilities Author: Kelly Kearney

It's a great program, and does exactly what I need it to do. There appears to be a small problem, which can easily be avoided but it would be great if you could fix it. When using subplots, if you use the "anchor" flag *and* have a legend label that is long enough to extend outside of the plot area, then when you open a new subplot, the old legend disappears. The following example illustrates the problem. As noted, it only arises when the anchor and the longLegend flags are turned on. Obviously, one can get around this problem by increasing the 'Position' dimensions of the subplot

close all;
legFontSize = 5;
legXScale = 0.5;
longLegend = 1;
anchorOn = 1;
for ii=1:15;
subplot(3,5,ii);
hold on;
h{ii}(1) = plot(1:10);
h{ii}(2) = plot(2:11);
if longLegend;
currentLegend = {'This is a very very very long legend','nothing'};
else;
currentLegend = {'This','nothing'};
end;
if anchorOn;
legendflex(h{ii},currentLegend,'anchor',{'nw','nw'},'fontSize',legFontSize,'xScale',legXScale);
else;
legendflex(h{ii},currentLegend,'fontSize',legFontSize,'xScale',legXScale);
end;
if ii==2; keyboard;end;
end;

12 Dec 2014 legendflex.m: a more flexible, customizable legend Create a legend with more flexible positioning and labeling capabilities Author: Kelly Kearney

21 Jul 2014 RMVAR Remove variables from MAT-File RMVAR is a simple program that removes specified variable(s) from a MAT-File Author: Frederic Moisy

Thanks for this, most useful.

I modified the file slightly, so that if the variable you tried to remove isn't actually in the matfile, then the program reports this but doesn't crash:

error(nargchk(2,inf,nargin));
WHOS = whos('-file',filename);
removeThese = {};
for ii=1:numel(varargin);
if isempty(strmatch(strvcat(WHOS(:).name),varargin{ii}));
disp([ varargin{ii} ' isn''t saved in ' filename ]);
else
removeThese = [ removeThese , varargin{ii} ];
end;
end;
vars = rmfield(load(filename),removeThese);
save(filename,'-struct','vars');

09 Jan 2014 suplabel Places text as a title, xlabel, or ylabel on a group of subplots. Author: Ben Barrowes

Great script. Is there any way to use \bar and \tilde with it? It appears not to be possible. E.g.,
\suplabel('\xi','t')
works fine but
\suplabel('\bar{\xi}','t')
can't interpret the string. The handle doesn't appear to have an 'Interpreter' field either.

25 Apr 2013 legendshrink Shrinks the length of the legend lines. Author: Will Robertson

I'd prefer to leave the legend box on. Is there any way of shrinking the box as you shrink the lines?

Contact us