0001 function plotbra(p,wnr,cmp,varargin)
0002
0003
0004
0005
0006 pp=p.branch(4+cmp,:);
0007 noa=nargin-3;
0008 figure(wnr); hold on;
0009 if(noa==0); plot(p.branch(3,:),pp); return; end
0010
0011 ms=5;rms=0;lms=5;
0012 inc=1; nl=0;
0013 ox=0; oy=0; fs=16; cl='black';
0014 fp=1; lp=size(p.branch,2);
0015 lwst=4; lwun=2; tyun='-'; tyst='-';
0016 k=1;
0017 while k<=noa
0018 switch lower(varargin{k})
0019 case 'lwun'; lwun=varargin{k+1}; k=k+2;
0020 case 'lwst'; lwst=varargin{k+1}; k=k+2;
0021 case 'lw'; lwst=varargin{k+1}; lwun=lwst/2; k=k+2;
0022 case 'tyun'; tyun=varargin{k+1}; k=k+2;
0023 case 'tyst'; tyst=varargin{k+1}; k=k+2;
0024 case 'ms'; ms=varargin{k+1}; k=k+2;
0025 case 'rms'; rms=varargin{k+1}; k=k+2;
0026 case 'inc'; inc=varargin{k+1}; k=k+2;
0027 case 'lab'; la=varargin{k+1}; nl=length(la); k=k+2;
0028 case 'labi'; bralen=size(p.branch,2);
0029 la=p.branch(1,1):varargin{k+1}:p.branch(1,bralen);
0030 nl=size(la); nl=nl(2); k=k+2;
0031 case 'labo'; ox=varargin{k+1};oy=varargin{k+2}; k=k+3;
0032 case 'fs'; fs=varargin{k+1}; k=k+2;
0033 case 'fp'; fp=varargin{k+1}; k=k+2;
0034 case 'lp'; lp=varargin{k+1}; k=k+2;
0035 case 'cl'; cl=varargin{k+1}; k=k+2;
0036 otherwise; break;
0037 end
0038 end
0039 for i=fp:lp-1
0040 if (p.branch(2,i)==0 && p.branch(2,i+1)~=0)
0041 if size(p.bifvals,2)>0
0042 if isempty(intersect(p.bifvals(1,:),i))==0
0043 plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0044 elseif isempty(intersect(p.bifvals(1,:),i+1))==0
0045 plot(p.branch(3,i:i+1),pp(i:i+1),tyst,'Linewidth',lwst,'color',cl);
0046 else plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0047 end
0048 end
0049 else plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0050 end
0051 if (p.branch(2,i)~=0 && p.branch(2,i+1)==0)
0052 if size(p.bifvals,2)>0
0053 if isempty(intersect(p.bifvals(1,:),i))==0
0054 plot(p.branch(3,i:i+1),pp(i:i+1),tyst,'Linewidth',lwst,'color',cl);
0055 elseif isempty(intersect(p.bifvals(1,:),i+1))==0
0056 plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0057 else plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0058 end
0059 end
0060 else plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl);
0061 end
0062
0063 if (p.branch(2,i)==0 && p.branch(2,i+1)==0)
0064 plot(p.branch(3,i:i+1),pp(i:i+1),tyst,'Linewidth',lwst,'color',cl);end
0065 if (p.branch(2,i)~=0 && p.branch(2,i+1)~=0)
0066 plot(p.branch(3,i:i+1),pp(i:i+1),tyun,'Linewidth',lwun,'color',cl); end
0067 end
0068 if(ms>0)
0069 for i=1:size(p.bifvals,2)
0070 if (p.bifvals(1,i)>=fp && p.bifvals(1,i)<=lp)
0071 plot(p.bifvals(4,i),p.bifvals(5+cmp,i),'o','MarkerSize',ms,'color',cl);
0072 end
0073 end
0074 end
0075 if(rms>0)
0076 for i=fp:inc:lp
0077 if (p.branch(2,i)==0) plot(p.branch(3,i),pp(i),'*','MarkerSize',rms,'color',cl);
0078 else plot(p.branch(3,i),pp(i),'+','MarkerSize',rms,'color',cl);
0079 end
0080 end
0081 end
0082 for k=1:nl;
0083 if (la(k)>=fp && la(k)<=lp)
0084 ls=mat2str(la(k)); x=p.branch(3,la(k))+ox; y=pp(la(k))+oy;
0085 text(x,y,ls,'FontSize',fs,'color',cl);
0086 xx=p.branch(3,la(k)); yy=pp(la(k));
0087 plot(xx,yy,'.','MarkerSize',lms*lwst,'color',cl);
0088 end
0089 end
0090 axis tight;box on; set(gca,'FontSize',fs);