|
From: SourceForge.net <no...@so...> - 2003-06-12 21:20:25
|
Patches item #753569, was opened at 2003-06-12 16:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442888&aid=753569&group_id=45430 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Marcus Mendenhall (mendenhall) Assigned to: Nobody/Anonymous (nobody) Summary: Axis partitioner for formatting dates & times nicely Initial Comment: I have been doing quite a bit of work collecting data over periods of days and weeks, an have started working on a partitioner which produces nice looking time axes in PyX. I am attaching the code, which should take very much massaging to include in the main PyX distribution, if you think this would be useful (I do). In the near future, I will probably implement another partioner useful for data extending over months & years (which will create non- uniform partitions with ticks at real month boundaries, etc.). A sample of a web page which is being updated with this is: http://129.59.235.188/~michael/Environmental.html which shows some environmental data from our building. Note that to get the most current graphs, you have to click the 'update graphs' button, then go back to the original page and refresh it. We are still developing the website, so it is a little crude in the mechanistics. Note that becasue of the way I have declared the format strings as class globals, it is very easy to override the formatting. The small sample subclass michaeltimepart is the one being used on the webpage. The main difference in this case is the slash in the month/day spec. I prefer this method for handling variations to including all possible information in the arguments to the constructor, since python subclassing is so easy. If you would rather handle format variations as arguments, the changes are easy. Maybe the best bet would be to have format string as arguments defaulted to None, in which case the class defaults arre used, but if non-None formats are given, they override the class defaults. This would allow both programming styles. Comments? Marcus Mendenhall ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442888&aid=753569&group_id=45430 |