From: John H. <jd...@gm...> - 2008-02-13 02:16:43
|
On Feb 12, 2008 12:23 PM, Pierre GM <pgm...@gm...> wrote: > self.plot(current._dates-shift, current._series, lw=lw, ls=ls, c=c, > scalex=False, scaley=False) > self.highlightedline = len(self.lines)-1 # > return self.highlightedline > > As you see, I have an extra attribute (highlightedfreq) that stores the index > of the highlighted line: when I need to deselect the highlighted curve, I > just delete the corresponding element of the lines list. I haven't tested this, but a more direct route may be (plot returns a list of lines and the "myline," idiom extracts the first element into the variable "myline") myline, = ax.plot(x, y, ...) and then later when you want to remove: ax.lines.remove(myline) Hope this helps, JDH |