Hello. I am new at matplotlib and am trying to modify the lasso demo so that a line is drawn aound the polygon made of selected points, and so that this polygon area is shaded. Ive added the following code to the callback function but receive the error: CXX : Error creating object of type N2Py7SeqBaseINS_6ObjectEEE. Im sure this is a simple modification. Can anyone offer suggestions?
def callback(self, verts): ind = nx.nonzero(points_inside_poly(self.xys, verts)) for i in range(self.Nxy): if i in ind: self.facecolors[i] = Datum.colorin else: self.facecolors[i] = Datum.colorout xyo=list() for i in ind: xyo.append(self.xys[i]) col = RegularPolyCollection(fig.dpi, 7, sizes = 3, offsets=xyo, transOffset=ax.transData) ax.add_collection(col, autolim=True) trans = transforms.scale_transform(fig.dpi/transforms.Value(72.),fig.dpi/transforms.Value(72.)) col.set_transform(trans) # the points to pixels transform colors = [colorConverter.to_rgba(c) for c in ('r','g','b','c','y','m','k')] col.set_color(colors) self.canvas.draw_idle() self.canvas.widgetlock.release(self.lasso) del self.lasso ____________________________________________________________________________________ Don't get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users