Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. filename = 'Random_Events_All_Sorted_85GHz.csv'
  2. df = pd.read_csv(filename)
  3.  
  4. min37 = df.min37
  5. min85 = df.min85
  6. verification = df.five_min_1
  7.  
  8. #Numbers
  9. x = min85
  10. y = min37
  11. H = verification
  12.  
  13. #Estimate the 2D histogram
  14. nbins = 4
  15. H, xedges, yedges = np.histogram2d(x,y,bins=nbins)
  16.  
  17. #Rotate and flip H
  18. H = np.rot90(H)
  19. H = np.flipud(H)
  20.  
  21. #Mask zeros
  22. Hmasked = np.ma.masked_where(H==0,H)
  23.  
  24. #Plot 2D histogram using pcolor
  25. fig1 = plt.figure()
  26. plt.pcolormesh(xedges,yedges,Hmasked)
  27. plt.xlabel('min 85 GHz PCT (K)')
  28. plt.ylabel('min 37 GHz PCT (K)')
  29. cbar = plt.colorbar()
  30. cbar.ax.set_ylabel('Probability of Lightning (%)')
  31.  
  32. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement