for (a,b,p) in zpd: dst[ (a,b) ] += p x = linspace(0,1,nx) y = linspace(0,1,ny) print "Interpolating data..." fit = interpolate.RectBivariateSpline(x,y,dst,kx=1,ky=1,s=0) xi = linspace(0,1,nx*10) yi = linspace(0,1,ny*10) smoothDat = fit(xi,yi) print "Making the plot..." data = l10( smoothDat ) data[ where( data==-inf ) ] = 0 # This makes it log scale! figure() imshow(data.T,origin='lower',vmin=0,vmax=5,extent=[0,1,0,1]) # Y-axis is actually the "primary" axis... xlabel(options.xFN[:-4]) ylabel(options.yFN[:-4]) colorbar().set_label('Log10(counts)') if options.outFN: if options.outFN[-4:] == '.pdf': filename = options.outFN title(options.outFN[:-4]) else:
continue x = linspace(minX,maxX,nx) y = linspace(minY,maxY,ny) print "Interpolating data..." fit = interpolate.RectBivariateSpline(x,y,dst,kx=1,ky=1,s=0) print minX, maxX print minY, maxY #minX=0 # need to do this so that both origins are the same, since only one value is printed #minY=0 xi = linspace(minX,maxX,nx*10) yi = linspace(minY,maxY,ny*10) smoothDat = fit(xi,yi) data = - l10( smoothDat.max() ) + l10( smoothDat ) data[ where( data==-inf ) ] = data[ where( data != -inf ) ].min() savetxt( "%s_vs_%s.dat" % ( options.xFN[:-4].split('/')[-1], options.yFN[:-4].split('/')[-1] ), data.T ) # This makes it log scale! figure(figsize=(8,6)) h=0.18 axes((h,h,1-2*h,1-2*h)) imshow(data.T,origin='lower',vmin= - options.orders,vmax=0,aspect='auto',cmap='hot_r') # Y-axis is actually the "primary" axis... print minX, maxX, minY, maxY #xticks( xticks()[0][1:-1], [ round(xi[i],2) for i in xticks()[0][1:-1] ] ) #yticks( yticks()[0][1:-1], [ round(yi[i],2) for i in yticks()[0][1:-1] ] ) xLbl = linspace( minX , maxX, (maxX - minX) * 2 + 1 )