Hello all,

I am looking for a way to add points gradually to the plot over time.
Currently, in every iteration, I plot the entire array, like:

fig = plt.figure();
ax = fig.gca()
xs = array([])
ys = array([])
while not done:
  // do some calculation..
  // x=???, y=???
  xs = append(xs,x);
  ys = append(ys,y);
  ax.plot(xs,ys)
  plt.draw()

However, it seems like that the figure is re-drawn completely and so
significantly harms the performance. Rather, I want to add point each
iteration to the plot.

fig = plt.figure();
ax = fig.gca()
while not done:
  // do some calculation..
  // x=???, y=???
  ax.AddPoint(x,y)
  plt.draw() // or update()?

I searched tutorials, but I couldn't find anything related yet. If anyone
knows how, please let me know.

Thanks all,

-- 
View this message in context: 
http://old.nabble.com/Adding-points-gradually-to-the-plot-tp27148794p27148794.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to