I am trying to plot a bar chart from a dictionary for Eg:
Dic = OrderedDict([('PROFESSIONAL_SERVICES', 621), ('WEB_SEARCH', 381), ('REMOTE_ACCESS', 160), ('Microsoft Category', 141), ('INTERNET_SERVICES', 62)])
I want to get a bar chart like the one in the following screenshot:
Here is the code that I am using so far:
import matplotlib.pyplot as plt
from Processesing import dataProcess
def chartmak (dic) :
D={}
D=dic
plt.barh(range(len(D)), D.values(),align='center',color="#add8e6")
plt.xticks(D.values, D.keys())
plt.gca().invert_yaxis()
plt.show()
NB: I am calling this function from another .py file
Any idea if it is possible to get a bar chart like the one in the screenshot?


