seaborn icon indicating copy to clipboard operation
seaborn copied to clipboard

Stack move puts levels in opposite order from legend

Open mwaskom opened this issue 2 years ago • 1 comments

(
    so.Plot(diamonds, "price", color="cut")
    .add(so.Bar(width=1, edgewidth=.25), so.Hist(), so.Stack())
    .scale(x="log")
)

image

This is something we handled in the distribution functions by internally reversing the hue_order. That ended up causing headaches, because artists are attached to the axes in the opposite order from what one expects. (Actually, that approach was also used so that the "top" category would also have the highest zorder, which is also a good idea). So maybe let's not do that but I think we should still fix this because it looks weird / confusing.

mwaskom avatar Jul 05 '22 21:07 mwaskom

Maybe should be handled separately, but same basic issue with dodged horizontal plots:

(
    so.Plot(tips, y="day", x="total_bill", fill="sex")
    .add(so.Bar(), so.Agg(), so.Dodge(gap=.1))
)

image

mwaskom avatar Jul 13 '22 02:07 mwaskom