Skip to content

Instantly share code, notes, and snippets.

@abhishekmamdapure
Created June 11, 2020 11:35
Show Gist options
  • Save abhishekmamdapure/b60812046612246817222e446731d62d to your computer and use it in GitHub Desktop.
Save abhishekmamdapure/b60812046612246817222e446731d62d to your computer and use it in GitHub Desktop.
# this will create 365 images in the path given
# please set the path before executing
lon, lat = np.meshgrid(long,lats)
x,y = mp(lon,lat)
plt.figure(figsize=(6,8))
# loop for all the days
days = np.arange(0,365) # for considering all days of the year
for i in days:
c_scheme = mp.pcolor(x,y,np.squeeze(tave[i,:,:]),cmap = 'jet')
mp.drawcoastlines()
mp.drawstates()
mp.drawcountries()
cbar = mp.colorbar(c_scheme,location='right',pad = '10%')
day = i+1
plt.title('Average Temperature for the Day ' + str(day) + ' of year 2019')
plt.clim(-20,20)
plt.savefig(r'path\where\to\save\images'+ '\\' + str(day)+'.jpg')
plt.clf()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment