adjust_legend

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 boxtrim = 0.85;%1;%
0002 lineshift = 0;
0003 textshift = -0.05;
0004 
0005 fch = get(gcf,'children');
0006 leg = fch(1);%legend
0007 %
0008 set(leg,'PlotBoxAspectRatio',[1,boxtrim,1]);
0009 
0010 lch = get(leg,'children');
0011 
0012 for ich = 2:3:length(lch),
0013     set(lch(ich),'ydata',get(lch(ich),'ydata') + lineshift),
0014 end
0015 for ich = 3:3:length(lch),
0016     set(lch(ich),'position',get(lch(ich),'position') + [0,textshift,0]);
0017 end

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.