I have a dataframe that looks like this.
raw_data = {'Enum': ['E330','E322','E124','E500'],'Count': [234, 122, 765, 433],
'Colors':['red','blue','green','yellow']}
additives_count = pd.DataFrame(raw_data)
I want to plot a histogram and I used the code below.
ax = additives_count.plot(kind='barh',colors=additives_count['Colors'])
The only problem is that I cannot make the corresponding colors in Enum. I got my bar plot, but only 1 color. So, for example, my plot should have E330, portrayed as red, E322 blue, E124 green, and E500 - yellow. How can i achieve this?
Please note that this is just a very small subset of my data. I have 30 lines to build, but I believe that you get the gist of what I'm trying to achieve. Any help would be greatly appreciated.
Thank!
source
share