I can't figure out a way to put a colormap on my bar chart. I want the color to be a gradient from left to right. Thanks for any help/suggestions.
import matplotlib.pyplot as plt
sorted_dict = OrderedDict(sorted(accidents_by_road_user.items(), key =
lambda kv:(kv[1], kv[0])))
roadkey = sorted_dict.keys()
roadvalue = sorted_dict.values()
fig = plt.figure(dpi=100, figsize=(10,4))
plt.bar(roadkey, roadvalue)
plt.title('Distribution of Accidents by the Primary Road User', fontsize=12)
plt.ylabel('Number of Accidents', fontsize=9)
plt.xlabel('Type of Primary Road User', fontsize=9)