I'm trying to produce a temperature colormap of a netcdf file with python. This is the first part of the code:
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
my_path = 'tas_EUR-44_GISS-E2-R_historical_r1i1p3_AUTH-MC-WRF371M_v1_3hr_2005010100-2005123121.nc'
fh = Dataset(my_path, mode='r')
lons = (fh.variables['lon'][:])
lats = (fh.variables['lat'][:])
t = (fh.variables['tas'][:])
t_units = fh.variables['tas'].units
fh.close()
lon_0 = lons.mean()
lat_0 = lats.mean()
m = Basemap(width=5000000, height=3500000,
resolution='l', projection='stere', \
lat_ts=40, lat_0=lat_0, lon_0=lon_0)
cs = m.pcolor(lons, lats, t[0, 0, :, :])
Once arrived at this command line, it appears this warning:
/Users/me/anaconda/lib/python3.6/site-packages/mpl_toolkits/basemap/init.py:3677: MatplotlibDeprecationWarning: axes.hold is deprecated. See the API Changes document (http://matplotlib.org/api/api_changes.html) for more details. ax.hold(b)
I tried also including hold=False, but the result is the same, as you can see in the imagine: no contourf. What am I missing?