0001 function hplot(bc,n,opt,lim)
0002
0003
0004
0005
0006
0007
0008
0009 if(~exist('opt'))
0010 opt=' ';
0011 end
0012
0013
0014 bw=bc(2)-bc(1);
0015
0016 if(~exist('lim'))
0017 lim=[bc(1)-bw/2,bc(end)+bw/2];
0018 end
0019
0020
0021 ind=bc>lim(1)&bc<lim(2);
0022 bc=bc(ind);
0023 n=n(ind);
0024
0025
0026 be=bc(1)+bw/2:bw:bc(end);
0027 be2=[be;be];
0028 be2=[bc(1)-bw/2,be2(:)',bc(end)+bw/2];
0029
0030
0031 n(n==0)=1e-99;
0032
0033 n2=[n;n];
0034 n2=n2(:)';
0035
0036 optp=opt(opt~='L'&opt~='S');
0037
0038 if(~any(opt=='S'))
0039 plot(be2,n2,optp);
0040 xlim([be2(1),be2(end)]);
0041
0042 m=max(n);
0043 if(any(opt=='L'))
0044 m=max(n)*2;
0045 ylim([m/1e6,m]);
0046 set(gca,'YScale','log');
0047 else
0048 ylim([0,max(n)*1.1]);
0049 end
0050 else
0051 hold on
0052 plot(be2,n2,optp);
0053 hold off
0054 end