Fix categorical hue splits with explicit hue order (#3922) #3971

Open
poorvajasathasivam opened 8:14am on August 5, 2026 wants to merge 63 Ξ” into mwaskom/seaborn master from
fix-categorical-hue-order
Diff Delta:
63
About 52 Diff Delta/hour
Classified as:  Bug Fix

poorvajasathasivam's Description of Work

Closes #3922.

Fixes an issue where categorical hue data could be split incorrectly when the pandas categorical dtype order differed from hue_order. In that case, plots such as violinplot could show the right hue labels/colors but draw them with the wrong subset of data.

The fix updates the shared iter_data splitter to match grouping keys by value directly instead of relying on GroupBy.get_group.

Tests added for the low-level splitter and violinplot.

3 total changed files
Loading changes...
Loading changes...
Loading changes...
Review complete πŸ’ͺ
PR review complete, one step closer to shipping πŸš€