From: Sandro T. <mat...@gm...> - 2009-06-15 14:59:17
|
On Mon, Jun 15, 2009 at 16:36, TP<par...@fr...> wrote: > Hi everybody, > > I want to modify a matplotlib.lines.Line2D and update the plot. > I have used Line2D._y member to modify the line. It works. But by doing > canvas.draw() (see example below), the line is not updated on the plot. To > update it, I have to do autoscale_view(). But I do not want the x and y > ranges of the plot to be changed. I think you want the 'line.set_ydata' method, where you pass the new Y data for your plot (there are also set_xdata and set_data to set, respectively, the X data and the whole set of X/Y); then call a draw on the canvas. Regards, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi |