source:
issm/oecreview/Archive/24307-24683/ISSM-24436-24437.diff
Last change on this file was 24684, checked in by , 5 years ago | |
---|---|
File size: 1.1 KB |
-
../trunk-jpl/src/m/plot/legendd.m
1 function legendd(varargin) 2 3 options=pairoptions(varargin{:}); 4 5 %retrieve arguments: 6 x=getfieldvalue(options,'x',0); 7 y=getfieldvalue(options,'y',0); 8 w=getfieldvalue(options,'w',1); 9 h=getfieldvalue(options,'h',1); 10 facecolor=getfieldvalue(options,'FaceColor','w'); 11 edgecolor=getfieldvalue(options,'EdgeColor','k'); 12 strings=getfieldvalue(options,'strings',{}); 13 colors=getfieldvalue(options,'colors',{}); 14 fontsize=getfieldvalue(options,'FontSize',12); 15 linewidth=getfieldvalue(options,'LineWidth',2); 16 17 hold on; 18 rectangle('Position',[x,y,w,h],'FaceColor',facecolor,'EdgeColor',edgecolor); 19 20 nl=length(strings); 21 for i=1:nl, 22 l=line([x+w/6 x+w/3],[y+(nl+1-i)*h/(nl+1) y+(nl+1-i)*h/(nl+1)]); 23 set(l,'Color',colors{i}); 24 set(l,'LineWidth',linewidth); 25 text(x+1.3*w/3,y+(nl+1-i)*h/(nl+1),strings{i},'FontSize',fontsize); 26 end 27
Note:
See TracBrowser
for help on using the repository browser.