Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. map = Basemap(projection='cyl',llcrnrlat=lowerllat,urcrnrlat=upperrlat,
  2. llcrnrlon=lowerllon,urcrnrlon=upperrlon,
  3. resolution='h')
  4. # lllat, urlat,lllon, urlon set outside of f(x) lower left and upper right lat/lon for basemap axis limits
  5.  
  6. x, y = map(lons[:,:], lats[:,:])
  7. map.contourf(x, y, U_10m, vmin=0, vmax=20)
  8.  
  9. parallels = np.arange(-85.,85,1.)
  10. meridians = np.arange(-180.,180.,1.)
  11. map.drawcoastlines(linewidth = 2, color = '0.15')
  12. map.drawparallels(parallels,labels=[False,True,True,False])
  13. map.drawmeridians(meridians,labels=[True,False,False,True])
  14. cbar = plt.colorbar(boundaries=np.linspace(0,1,20))
  15. cbar.set_label('10m U (m/s)', size=20)
  16. cbar.set_clim(0, 20)
  17.  
  18. #failed attempt:
  19. cbar = plt.colorbar.ColorbarBase(ax, cmap=cm,
  20. # norm=plt.colors.Normalize(vmin=0, vmax=20))
  21. #AttributeError: 'function' object has no attribute 'ColorbarBase'#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement