Plotting a cumulative graph of python datetimes

Posted by ventolin on Stack Overflow See other posts from Stack Overflow or by ventolin
Published on 2010-06-13T22:34:49Z Indexed on 2010/06/13 22:42 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

Say I have a list of datetimes, and we know each datetime to be the recorded time of an event happening.

Is it possible in matplotlib to graph the frequency of this event occuring over time, showing this data in a cumulative graph (so that each point is greater or equal to all of the points that went before it), without preprocessing this list? (e.g. passing datetime objects directly to some wonderful matplotlib function)

Or do I need to turn this list of datetimes into a list of dictionary items, such as:

{"year": 1998, "month": 12, "date": 15, "events": 92}

and then generate a graph from this list?

Sorry if this seems like a silly question - I'm not all too familiar with matplotlib, and would like to save myself the effort of doing this the latter way if matplotlib can already deal with datetime objects itself.

© Stack Overflow or respective owner

Related posts about python

Related posts about datetime