[Matplotlib-users] Update subplot

Thomas Caswell tcaswell at gmail.com
Fri Oct 9 22:09:55 CEST 2015


Lars,

I am not sure what you mean by "set_data() and draw() for a subplot.".

If you have a reference to the `Line2D` object, a call to `set_data` will
update the x, y values for that line.

Tom

On Fri, Oct 9, 2015 at 7:19 AM Lars Eriksson <info at lbm.nu> wrote:

> I need to update a plot continuously and if I use
> ax1.clear()
> ax.plot(y)
> fig.show()
> It work well, but allocate memory for each update and take all CPU resource
> after a while.
> To solve the memory allocation problem I used
> line.set_xdata()
> line.set_ydata()
> plt.draw()
> But I can't find how to use set_data() and draw() for a subplot.
>
> Thanks
> Lars
>
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Update-subplot-tp46269.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151009/f6ed4fbf/attachment.html>


More information about the Matplotlib-users mailing list