thanks, it is exactly what I need... I have undestood the logic, I build a plot, put my traits values into an array and then I call the add_current_state_to_plot function to update the plot with the new values...
I am an absolute beginner of matplotlib, can you give me a little example of add_current_state_to_plot function? Because I don't know the right way to update: do I have to pass all the array, or just the new values? best regards, simone 2009/1/18 C Lewis <chle...@nature.berkeley.edu>: > Guessing about what you want: > > Does the class change with time? that is, perhaps you have a class foo, and > foo evolves, and you would like to plot a history of some traits of foo, but > at any given moment foo only contains its current state? > > If so, I think you need to have a function in foo, or even a separate class, > that takes `snapshots' of foo's traits on one schedule, and stores them, and > can also plot them on some schedule. Choosing how to do that is more a > python problem than a matplotlib problem; personally, I have something set > up so class 'profile' has functions to 'setup_plot' and > 'add_current_state_to_plot', and I just have to choose when to call the > latter. > > Or you can just store the values and plot at the end; once you have one list > of the times, and a separate list of each trait's history at those times, > you're set up for matplotlib plotting, e.g. > > from pylab import * > plot(times, traitA, times, traitB, times, traitC) > show() > > although, while looking for a simple example, I found this: > > http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html > > which is not totally simple but looks great. > > > &C > > On Jan 18, 2009, at 9:36 AM, Simone Gabbriellini wrote: > >> Dear List, >> >> I have some variables I want to plot... the values of those variable >> change in time... I would like to plot the result with a traditional >> line plot >> >> those variables are traits of a class (don't know if this can make a >> difference...) >> >> is there any example of this with matplotlib? >> >> best regards, >> simone gabbriellini >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> SourcForge Community >> SourceForge wants to tell your story. >> http://p.sf.net/sfu/sf-spreadtheword >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users