reverse-shooting

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

figlinesg.m (1005B)


      1 function []=figlinesg(x,y,yesdot,dotlabel,justone,linewidth);
      2 
      3 % g= green lines
      4 
      5 % Add dashed lines from (x,ymin) to (x,y) and (xmin,y) to (x,y).
      6 % Add a dot at (x,y) if yesdot==1;
      7 % justone='x' then just draw the vertical line at position x
      8 % justone='y' then just draw the horizontal line.
      9 % justone='n' then don't draw either line, just dot/label.
     10 
     11 cax=axis;
     12 xmin=cax(1);
     13 ymin=cax(3);
     14 if ~exist('justone'); justone='b'; end;
     15 if ~exist('linewidth'); linewidth=1; end;
     16 
     17 hold on;
     18 %plot([x x],[ymin y],'g:','LineWidth',1.5);
     19 %plot([xmin x],[y y],'g:','LineWidth',1.5);
     20 if justone=='x' | justone=='b';
     21   plot([x x],[ymin y],'--','LineWidth',linewidth,'Color',[0 .6 .4]);
     22 end;
     23 if justone=='y' | justone=='b';
     24   plot([xmin x],[y y],'--','LineWidth',linewidth,'Color',[0 .6 .4]);
     25 end;
     26 
     27 if exist('yesdot');
     28   if yesdot;
     29     plot(x,y,'o','MarkerFaceColor',[0 .6 .4]);
     30     if exist('dotlabel');
     31       text(x,y,dotlabel,'HorizontalAlignment','left','VerticalAlignment','bottom','FontSize',16);
     32     end;
     33   end;
     34 end;