Answer the question
In order to leave comments, you need to log in
How to change color of barplot, barh depending on values in dataframe column?
Hello. I am building several graphs - horizontal barplots (specifically - 15) in matplotlib, x, y values are columns from the dataframe. It is necessary to make the color of the charts change depending on the values in another column of the same dataframe, and add the corresponding legend. I don't understand how to do this in my loop.
Answer the question
In order to leave comments, you need to log in
Implementing this in a loop is a bad idea. Break the program into functions.
Well, if you can’t do it right, then you can come up with something with dict. But for this you need more specifics about the choice of color.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question