From: chuck c. <cc...@zi...> - 2002-09-27 03:03:21
|
Leo, The mxdate package which Michael speaks of is a great package indeed and handles datetime data very well and has almost any date/time functions you could think of. I think my problem lies in the fact of I'm not sure which PlotItem type from gnuplot-py I should use. I was originally trying to use Data but of course "12:01" can't be converted to a Numeric Float array. So now I'm taking a step back and wondering if I need to create my own PlotItem types of Date, Time and DateTime to do this? I thought about doing as you say about converting my hh:mm:ss string into a float but it isn't really clean because time is base 60 and not decimal and I lose a lot of readability because suddenly my x-axis is not regular times that the user would expect to see but some decimal representation of it. If I somehow try to preserve the time by making 12:01 into 1201 then I'll have funny gaps from 1260 to 1300 and on every other hour. Gnuplot itself handles Date/Time types as seen in the 3.7.1 manual. If you had the data below in a file called test.dat you could plot it in Gnuplot with the following: 12:01 4.63 12:02 6.74 12:03 0.0 12:04 6.32 gnuplot> set xdata time gnuplot> set timefmt "%H:%M" gnuplot> set format x "%H:%M" gnuplot> set xrange ["12:00":"12:05"] gnuplot> plot "/home/cclark/test.dat" using 1:2 So I guess what I was wondering was if anyone had plotted date/time data using gnuplot-py with the existing PlotItem types or if people who were more familiar with the package than I am thought I'd need to come up with a new type. Any thoughts would be greatly appreciated. cheers, chuck |