Matthias Michler wrote:
> Hello Chris,
> 
> maybe I don't know exactly what you want to do - let me try once more:
> You try to plot a line where point need to be added, isn't it?
> My first idea was that there should be independent points.
> 
> maybe something like the following helps you:
> -----------------------------------------------------------------------------------------
> from pylab import *
> from time import sleep
> 
> ion()                     # interactive mode 'on'
> figure()
> ax = subplot(111, autoscale_on=True)
> 
> x, y = [0], [0]
> line = plot(x, y, label="my_data")[0]      
>                                     # get the line-object as the first 
> element 
>                                     # of the tuple returned by plot
> legend()
> for i in arange(10):
>     x.append(i)           # append new values
>     y.append(i**2)
>     line.set_data(x,y)    # reset data
>     ax.relim()            # reset axes limits
>     ax.autoscale_view()   # rescale axes
>     draw()                # redraw current figure
>     sleep(0.5)            # wait 0.5 seconds
> 
> ioff()
> show()
> --------------------------------------------------------------------------------
> 
> I don't know how to make this somehow interactive concerning the data input. 
> but maybe you save the data to a file and read them every 15 or 20 minutes.

You could combine this with the stuff in dynamic_demo* and 
dynamic_image* in the examples directory.  Basically, you write some 
kind of handler that the gui mainloop repeatedly calls, which would 
handle reading the data and updating the plot like you did above.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to