From: Michael H. <hag...@jp...> - 2002-09-26 06:28:10
|
Chuck, [I have cc'ed this email to the gnuplot-py-users mailing list. Please subscribe to that list if you are interested in following Gnuplot.py developments: http://lists.sourceforge.net/lists/listinfo/gnuplot-py-users .] chuck clark <cn...@us...> writes: > Michael, > I am a decent Python programmer but just started > using Gnuplot and Gnuplot-py yesterday so please > forgive me if this is an obvious question with an > obvious answer that I've just missed. > Is there a way to plot Time/Data data in Gnuplot-py? > I've got some two dimensional data that looks like > the following: > > 12:01:30 4.63 > 12:02:30 6.74 > 12:03:30 0.0 > 12:04:30 6.32 > > I can get this to plot directly in Gnuplot but I > can't seem to create a Gnuplot.Data that can > handle the time type data. Is there something I'm > missing? If plotting this kind of data is not > possible then is there any chance Gnuplot-py will > be supporting it in the near future? I don't have any experience myself with using date-formats in gnuplot, so I wouldn't know how to support them in Gnuplot.py. The Gnuplot.py Data class stores its data internally as a Numeric array of floating point data. It has no way of storing (let alone plotting) data in another format. If gnuplot requires date data formatted as you mentioned, how would you want to store it within Gnuplot.py? As strings? Date objects of some sort? If you have a rather specific purpose in mind, you could easily write a class derived from PlotItem that prints its contents in the format that you need. If you want it to be more generally useful, you base it on the Data class but instead of using Numeric arrays of float to store its data it would use Python lists (or perhaps Numeric arrays of Python objects, though last time I checked they didn't work too well). If you decide to derive from PlotItem, then I would strongly recommend that you base your work on the latest CVS version of Gnuplot.py since the PlotItem interface has changed significantly. I haven't gotten around to making a new release but when I do it will include the new interface. In fact, I just realized that Numeric isn't really required for very much in Gnuplot.py. It might be easy to provide a non-Numeric mode, which would be interesting to me at the moment because I'm mostly using Jython in my current work and JNumeric isn't well-developed. Yours, Michael -- Michael Haggerty hag...@jp... |