I'm doing an horizontal barplot. I need one specific bar (type=milk) to have a green fill color, and gray for the other types. The dataframe is:
df = DataFrame(val = c(1, 2, 3, 6, 7, 8),
type = c("honey","bread","coffee","bread","honey","milk"))
I have tried this without success:
clrs = ['green' if ((x == milk) else 'gray' for x in type]
ax.barh(df['type'], (df['val']), align='center', colors=clrs)
Any ideas?