Dynamic plotting?

Hi list

I've been asked to transform my app to something more "dynamic"
it currently reads an xml file, it has now to read a stream of xml from
a socket (I can handle this part :D) and plot each point as they are
coming from the network.

I'll end up having tons of points over multiple axes; I guess doing
sonething like fig.plot(concat(old-data,new-point)) would be rather
inefficient and I wonder if someone ever made something like this using
matplotlib?

or any hints on where to start from?

thanks :slight_smile:

···

----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you.

Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----

Hello guillaume,

···

On Mon, Jun 29, 2009 at 10:53, guillaume ranquet<granquet@...2572...> wrote:

I've been asked to transform my app to something more "dynamic"
it currently reads an xml file, it has now to read a stream of xml from
a socket (I can handle this part :D) and plot each point as they are
coming from the network.

I'll end up having tons of points over multiple axes; I guess doing
sonething like fig.plot(concat(old-data,new-point)) would be rather
inefficient and I wonder if someone ever made something like this using
matplotlib?

You can refer to animation examples [1] for code that does what you want.

[1] http://matplotlib.sourceforge.net/examples/animation/index.html

at the very end, you update the line data with set_ydata() ,
set_xdata() or set_data() and then call a draw() on the figure.

Regards,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

Sandro Tosi wrote:

Hello guillaume,

I've been asked to transform my app to something more "dynamic"
it currently reads an xml file, it has now to read a stream of xml from
a socket (I can handle this part :D) and plot each point as they are
coming from the network.

I'll end up having tons of points over multiple axes; I guess doing
sonething like fig.plot(concat(old-data,new-point)) would be rather
inefficient and I wonder if someone ever made something like this using
matplotlib?

You can refer to animation examples [1] for code that does what you want.

[1] http://matplotlib.sourceforge.net/examples/animation/index.html

at the very end, you update the line data with set_ydata() ,
set_xdata() or set_data() and then call a draw() on the figure.

Regards,

oh, I knew about set_{x,y,}data() but I actually though I had to feed it
the whole dataset each time.
It's clear enough in the examples :slight_smile:

maybe the doc should be a bit more verbose?
http://matplotlib.sourceforge.net/api/artist_api.html?highlight=set_ydata#matplotlib.lines.Line2D.set_ydata

thanks.

···

On Mon, Jun 29, 2009 at 10:53, guillaume ranquet<granquet@...2572...> wrote:

----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you.

Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----