Hello,
> 1. What libraries/modules should I be using to draw these graphs?
matplotlib
Samples: http://www.google.lt/search?q=matplotlib+pylons
> 2. Is there any plotting library that understands datetime objects,
> and can graph them intelligently?
>
> If the answer to 2 is no...
I don't know.
> 3. How can I turn a datetime object (essentially six numbers) into a
> single floating point number? For instance, Friday at 1 PM is 6.93,
> and Friday at 3 PM is 7.71, or something like that which will be
> possible to graph. Know what I mean? I need to translate/transform a
> datetime object into a single number that will create a non-distorted
> graph when that number is used as the X-value for an event (data
> point).
1. Convert datetime object to timestamp object.
2. Convert previous Monday or Sunday to timestamp (is in seconds).
3. Subtract one from another and divide them by number of seconds in
day (or whatever you want).
> 4. How can I change the labels on the X-axis to say Friday, 1 PM,
> instead of saying 6.93.
I guess 1 PM is more like 6.54 or even 5.54 or 4.45.
1) int(5.54) => 5.
2) {0: 'Sunday', 1: 'Monday'....
3) round((5.54-int(5.54))*24) -> 13 ...
> Thank you. Also, if I have to do 3 and 4 I will be really, really sad.
Don't be lazy ;-)
--
Dalius
http://blog.sandbox.lt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---