reverse-shooting

Matlab scripts for reverse shooting
Log | Files | Refs | README

plotname.m (657B)


      1 % plotname.m
      2 %
      3 % Creates a plot using the names 'names' instead of plot symbols in the
      4 % graph.  Works best if names are only two or three characters long.
      5 
      6 function []=plotname(x,y,names,fsize,color);
      7 
      8 if exist('fsize')~=1; fsize=8; end;
      9 if exist('color')~=1; color=[0 .4 0]; end;
     10 
     11 scalef=.10;
     12 minx=min(minnan(x));
     13 maxx=max(maxnan(x));
     14 miny=min(minnan(y));
     15 maxy=max(maxnan(y));
     16 distx=maxx-minx;
     17 disty=maxy-miny;
     18 minx=minx-scalef*distx;
     19 maxx=maxx+scalef*distx;
     20 miny=miny-scalef*disty;
     21 maxy=maxy+scalef*disty;
     22 axis([minx maxx miny maxy]);
     23 for i=1:size(y,2);
     24   text(x,y(:,i),names,'FontSize',fsize,'Color',color,'LineWidth',1);
     25 end;
     26 h=gca;
     27 set(h,'Box','on');