The World’s Largest Online Community for Developers
I am currently creating a stacked bar plot using a dataframe and I'd like to change the ordering of the bars in order of magnitude. I have a dataframe as following:
df = ( H C O A 2 1 3 B 1 2 1 C 3 1 1 D 1 2 3 E 1 3 1) df.plot.bar(stacked = True).legend(loc='upper center', ncol=3)
The problem I am coming into is that the first column has priority in ordering. I would like an output that stacks bars in increasing value found in each column.
I am not opposed to sending each row into a new list, or dataframe, or indices and plotting them separately and then concatanting, but I am very new to Python.