Hi all, I have plotted a 2D histogram like so:
python2.7 import netCDF4 import iris import iris.palette import numpy as np import matplotlib as mpl import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt from matplotlib.colors import from_levels_and_colors fig=plt.figure() nbins=20 nice_cmap=plt.get_cmap('brewer_RdYlBu_11') colors=nice_cmap([5,6,7,8,9,10]) levels=[1,2,3,4,5] cmap, norm=from_levels_and_colors(levels, colors, extend='both') H, xedges, yedges=np.histogram2d(te_Q0_con_sw,hs_Q0_con_sw,bins=nbins) Hmasked=np.ma.masked_where(H==0,H) plt.pcolormesh(xedges,yedges,Hmasked,cmap=cmap,norm=norm,label='Q0 control') # From this I get a 'scattered' 2D histogram. Does anyone know how I can contour that scatter? Thanks, Jamie -- https://mail.python.org/mailman/listinfo/python-list