Ben,

Thanks ! Can you explain a bit more on what you mean by path simplification ? Here is the code as I see it right now.

Also I had a second question - cs.levels returns the contour levels associated with the contours. Is there a dictionary that maps a contour level to the contour coordinates or is cs.collections in the same order as cs.levels?

`import numpy as np`

from netCDF4 import Dataset

import matplotlib.pyplot as plt

clevs = np.arange(5300.,5900.,20.)

cs = plt.contourf(lons, lats, np.squeeze(hgt),clevs)

for cc in cs.collections:

paths = []

for pp in cc.get_paths():

xy = []

for vv in pp.iter_segments():

xy.append(vv[0])

paths.append(np.vstack(xy))

contours.append(paths)

_______________________________________________

Matplotlib-users mailing list

[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users