From: Sebastian R. <seb...@go...> - 2009-09-02 15:41:53
|
Hello, I wrote a little program to display the spectral data of varoius filters. Here is a part of the code: ... def openex(self, event): dlg = wx.FileDialog(self, "Choose a Excitation Filter", os.getcwd(), "", "*.ex*", wx.OPEN) if dlg.ShowModal() == wx.ID_OK: pathex = dlg.GetPath() mypathex = os.path.basename(pathex) self.SetStatusText("Selected EX: %s" % mypathex) ex = load(pathex) ex = normspec_filter(ex) self.gex = self.axes.plot(ex[:,0],ex[:,1],'b', lw=2,label = mypathex) self.axes.axis([xmin,xmax,ymin,ymax]) self.axes.legend(loc=4) self.plotPanel.draw() dlg.Destroy() def delex(self, event): *self.axes.lines.remove(self.gex[-1])* self.plotPanel.draw() ... So I already figure out how to delete the last drawn line, but this is not a very good solution. What I actually would need, is a selection which line & legend the users whats to remove from the graph (perfect would be interactivly directly from the graph). But so far, I could not figure this out. Has anyone a good ides how to achieve this? Cheers, Sebi -- Dr. Sebastian Rhode Grünwalder Str. 103a 81547 München Tel: +49 89 4703091 seb...@go... |