plotting from a dictionary

Hey All,

I have a dictionary that maps date to a count (in this case the number of false negatives from my spam filter) and I'm wondering how to best plot something that looks like, say:

from datetime import date
data = {

I'm worried about getting the dates out in order such that I get a straight line plot, rather than the zigzag back-and-forth line I reckon I'd get if I did:

dates = []
count = []
for date,count in data.items:





Simplistix - Content Management, Zope & Python Consulting


Why wouldn't you try to use sorted on your dictionary, construct an array from
the result of sorted, and get the corresponding columns ?


print results[:,0]
[2008-01-01 2008-01-02 2008-01-03]
print results[:,1]
[10 30 20]