I have a set:
K = {'A', 'E', 'R', 'T'}
and a dictionary called:
Dic = {'A': 25, 'C': 35, 'E': 10, 'R': 7, 'S': 9, 'T': 11}
I know to plot the dictionary Dic
by
X = np.arange(len(Dic))
plt.bar(X,Dic.values(),width=0.5)
plt.xticks(X,list(Dic.keys()))
Now I want to change the colours of the bar 'A', 'E' , 'R', 'T'
in the graph. Simply like Dic
intersection K
.
But, I don't know how to compare the set items with the dictionary.