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