On Fri, Feb 6, 2009 at 5:13 AM, Rezwan <rezwan.huss...@gmail.com> wrote:
>
> Hi
> I am developing a plotting tool using matplotlib and wxpython as backend. I
> have separate thread for iperf and it creates a text file every time I want
> to create this thread and this thread finish it's task once it reach the
> duration(defined by the user). Plot and some text boxes are updated reading
> this text file every second once I press plot button. My problem is
> matplotlib keeps the old data and impose new data on the same plot. I am
> using cla function to clear the axes but how can I clear set_data for every
> new plot. What I want is to initialize set_data. Anyone here to tell me how
> can I do that? Hope my post makes sense. If not I will post with some
> snippets of my tool.
>

You will need to post some example code before we can really help, but
the best way to do this is not via cla, but by storing the line
instance and calling set_data on it

  line, = ax.plot(x, y)

and then later

  line.set_data(newx, newy)
  line.axes.figure.canvas.draw()

If you are getting overplotting, it sounds like you are making
additional calls to plot that you are overlooking.

JDH

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to