problem with set_data update/refresh in matplotlib using wxpython backend

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.

Cheers!
Rezwan

···

--
View this message in context: http://www.nabble.com/problem-with-set_data-update-refresh-in-matplotlib-using-wxpython-backend-tp21870522p21870522.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

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

···

On Fri, Feb 6, 2009 at 5:13 AM, Rezwan <rezwan.hussain@...287...> 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.