Plot crosstab results using All row as benchmark lines
1
I have this sample dataframe: test = pd.DataFrame({'cluster':['1','1','1','1','2','2','2','2','2','3','3','3'], 'type':['a','b','c','a','a','b','c','c','a','b','c','a']}) I use crosstab to produce a new dataframe and plot results: pd.crosstab(test.cluster,test.type,normalize='index',margins=True).plot(kind='bar') I would like to plot the row All as dotted horizontal benchmark lines of the same colour corresponding to each type to improve interpretation of the plot. Will appreciate help of this community!
python-3.x