How to display legends in order ? ( Pie Chart )

Ah dang, this is a little frustrating when using Plotly express with a color faceting to produce different traces. I have a sequence of years in my legend that are not sorted, and I can’t sort them using trace_orders as that reorders the actual traces, breaking the sorting of my the already sorted x-axis values.

Looking at the link click through counts in this thread and this other related thread on this issue, this could be a friction point for a few people: Customizing the order of Legends

2 Likes