Skip to content

Instantly share code, notes, and snippets.

@lollipoppizza
Created April 15, 2016 16:00
Show Gist options
  • Save lollipoppizza/581726e46560097ebd9757bea71e6ad2 to your computer and use it in GitHub Desktop.
Save lollipoppizza/581726e46560097ebd9757bea71e6ad2 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import shelve
from collections import OrderedDict
d = shelve.open("driverCountFriday")
data = d
print(tuple(data))
print(tuple(data.values()))
dataSorted = [(k,v) for v,k in sorted(
[(v,k) for k,v in data.items()],reverse=True
)
]
data = OrderedDict(dataSorted)
plt.bar(range(len(data)), data.values(), align='center')
plt.xticks(range(len(data)), data.keys(), rotation="vertical", fontsize = 10)
plt.savefig('FridayTest.png', bbox_inches='tight')
d.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment