color = []
for key,value in ms.iterrows():
if(value['Color']=='Blue'):
color.append('b')
elif(value['Color']=='Green'):
color.append('g')
elif(value['Color']=='Red'):
color.append('r')
elif(value['Color']=='Yellow'):
color.append('y')
elif(value['Color']=='Orange'):
color.append('o')
else:
color.append('k')
ax =ms[['Height','Color']].plot(x='Color', kind='bar', title="Correlation",
figsize=(15,10), color=color legend=True, fontsize=12)
ax.set_xlabel("Colors", fontsize=12)
ax.set_ylabel("Height", fontsize=12)
My intention is to plot a bar graph that shows Color against Height. I managed to do it. However, I would like each of the bars to show respective color. In accord with the data set, I would like the 1st bar to show red...and so on. I tried adding the color, but it still shows only 1 color.