From: Özgür <ozg...@m3...> - 2011-08-13 23:41:43
|
I guess that is the problem. Thanks for the idea. Regards, Ozgur On Sat, 13 Aug 2011, Benjamin Root wrote: > > > On Saturday, August 13, 2011, Özgür <ozg...@m3...> wrote: > > Please forget it. For now the real problem is: I am plotting by using "contour" and I get the data values by using get_paths. But > it does not include some part of the contour. A screenshot is attached. The colored lines are those returned by get_paths. But the > black line is not included. I guess this is a bug? > > > > contour = plt.contour(xi,yi,zi,numberoflevels,linewidths=1,colors='k') > > lev = contour.levels > > col = contour.collections > > polygons = [] > > for i in range(len(lev)): > > polygons.append (col[i].get_paths()[0].vertices) > > > > ... other code to plot the colored points... > > > > You are assuming that there are the same number of contours as levels. In the general case, this can never be assumed. Why not > just simply loop over the collections(or, even better, use a list comprehension)? > > Ben Root > |