Hello everyone, I hope you are well in these special times.
I have a dataframe with two cols, one of which I’m interested in having as the y value, let’s call it
vals. The other col, let’s call it
cat can only contain two values
N, which I want to use as the color of each bar. The issue is I want the bars to be sorted by
I was able to do this by sorting by vals beforehand, creating a list with two values for the colors (same length as the data), and providing plotly with a separate array/list with color for each bar (by providing the
marker dictionary with a color array) but now I’m unable to give this chart a proper legend. As I have two colors, I want the legend to have 2 items as well, and not the same number as the length of the data.
How can this be done?