Skip to content

Instantly share code, notes, and snippets.

@abhishekmamdapure
Last active June 11, 2020 11:36
Show Gist options
  • Save abhishekmamdapure/f1a17fe61b09ea0503000ce64fedb7fb to your computer and use it in GitHub Desktop.
Save abhishekmamdapure/f1a17fe61b09ea0503000ce64fedb7fb to your computer and use it in GitHub Desktop.
lon, lat = np.meshgrid(long,lats) #this converts coordinates into 2D arrray
x,y = mp(lon,lat) #mapping them together
plt.figure(figsize=(6,8)) #figure size
c_scheme = mp.pcolor(x,y,np.squeeze(tave[0,:,:]),cmap = 'jet') # [0,:,:] is for the first day of the year
# consider this as the outline for the map that is to be created
mp.drawcoastlines()
mp.drawstates()
mp.drawcountries()
cbar = mp.colorbar(c_scheme,location='right',pad = '10%') # map information
plt.title('Average Temperature for: Day 1 of year 2019')
plt.show()
plt.savefig('tave.jpg',dpi=300) #saves the image generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment