Plot a histogram from a Dictionary

You can use the function for plotting histograms like this:

a = np.random.random_integers(0,10,20) #example list of values
plt.hist(a)
plt.show()

Or you can use myDictionary just like this:

plt.bar(myDictionary.keys(), myDictionary.values(), width, color="g")

Leave a Comment