def plot3(curs): X=N.arange(-24,-15.5,1/3.0,dtype='f') P.semilogy(X,sdss.schechterBlanton(X),'k-',label='total (Blanton et al. (2001))') X=N.arange(-23,-15.5,1/3.0,dtype='f') M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND Ha_w > 100') y=sdss.lumfu(X,M,D) P.semilogy(X[2:],y[2:],'b-.s',label=r'$\mathrm{W(H\alpha)} > 100 \mathrm{\AA}$') M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND bpara2 >3') y=sdss.lumfu(X,M,D) P.semilogy(X,y,'b--*',label=r'$\mathrm{b} > 3$') M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND Massfrac> 0.03') y=sdss.lumfu(X,M,D) P.semilogy(X,y,'b^:',label=r'mass fraction $> 3 \%$') M,D=getpb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL') y=sdss.lumfu(X,M,D) P.semilogy(X,y,'r-D',label=r'$\mathrm{W(H\delta)} < -6 \mathrm{\AA}$') M,D=gettable(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=1',table='sb') y=sdss.lumfu(X,M,D) y=masked_where(X>=-18,y) P.semilogy(X,y,'g-o',label='AGN') P.xlabel(r'$M_r$') P.ylabel(r'$\Phi\quad [\mathrm{Mpc}^{-3}\, \mathrm{mag}^{-1}]$') P.rcParams.update({'legend.fontsize':10}) P.legend(loc='upper left') P.axis([-24.2,-15.5,4E-10,2E-2])
def plot19(curs): Fig=P.gcf() ax1=Fig.add_axes((.12,.4,.85,.58)) ax2=Fig.add_axes((.12,.07,.85,.33)) binsize=1/3.0 X=N.arange(-24,-15.5,binsize,dtype='f') Blanton=sdss.schechterBlanton(X) ax1.semilogy(X,Blanton,'k-',label='total (Blanton et al. (2001))') # completeness limit ax1.plot((-17,-17),(1E-8,1E-3),'k--',lw=3) ax2.plot((-17,-17),(1E-4,2E-2),'k--',lw=3) #M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND Ha_w > 100') #y=sdss.lumfu(X,M,D) #ax1.semilogy(X,y,'b-.s',label=r'$\mathrm{W(H\alpha)} > 100 \mathrm{\AA}$') #ax2.semilogy(X,y/Blanton,'b-.s',label=r'$\mathrm{W(H\alpha)} > 100 \mathrm{\AA}$') M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND bpara2 >3') y=sdss.lumfu(X,M,D) / binsize print X,y ax1.semilogy(X,y,'b--*',label=r'$\mathrm{b} > 3$') ax2.semilogy(X,y/Blanton,'b--*',label=r'$\mathrm{b} > 3$') M,D=getsb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=0 AND Massfrac> 0.03') y=sdss.lumfu(X,M,D) /binsize ax1.semilogy(X,y,'b^:',label=r'mass fraction $> 3 \%$') ax2.semilogy(X,y/Blanton,'b^:',label=r'mass fraction $> 3 \%$') M,D=getpb(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL') y=sdss.lumfu(X,M,D) / binsize ax1.semilogy(X,y,'r-D',label=r'$\mathrm{W(H\delta)} < -6 \mathrm{\AA}$') ax2.semilogy(X,y/Blanton,'r-D',label=r'$\mathrm{W(H\delta)} < -6 \mathrm{\AA}$') M,D=gettable(curs,cols='Mr,voldens',where='voldens NOTNULL AND Mr NOTNULL AND agn=1',table='sb') y=sdss.lumfu(X,M,D) /binsize y=masked_where(X>=-18,y) ax1.semilogy(X[3:],y[3:],'g-o',label='AGN') ax2.semilogy(X[3:],(y/Blanton)[3:],'g-o',label='AGN') ax1.set_xticklabels([]) ax1.set_ylabel(r'$\Phi\quad [\mathrm{Mpc}^{-3}\, \mathrm{mag}^{-1}]$') P.rcParams.update({'legend.fontsize':10}) ax1.legend(loc='upper left') ax1.axis([-24.2,-15.5,4E-10,2E-2]) ax2.set_xlabel(r'$M_r$') ax2.set_ylabel(r'$\mathrm{Fraction}$') ax2.axis([-24.2,-15.5,4E-5,4E-2])