You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Opacity and color not working together in px.scatter #4580
@NooraAz Thank you for the report, and apologies that this issue never got a timely reply!
This is indeed a bug; the issue is that the opacity argument accepts a list or colname without complaining, and applies it correctly to a plot where points are not split by color, but in the case where points are split by color, the opacity list is applied naively to each individual trace (red and blue) without being split, so the values are completely misaligned.
At the very least, we should reject providing a list or colname to opacity when splitting by color or faceting.
Ideally, we should correctly split and apply the list to each color such that the correct opacity values are aligned with the correct points. I looked into it a bit and it's probably doable but a little complex due to some quirks in the px machinery.
Activity
Coding-with-Adam commentedon Apr 19, 2024
Thank you for reporting @NooraAz
emilykl commentedon Sep 2, 2026
@NooraAz Thank you for the report, and apologies that this issue never got a timely reply!
This is indeed a bug; the issue is that the
opacityargument accepts a list or colname without complaining, and applies it correctly to a plot where points are not split by color, but in the case where points are split by color, theopacitylist is applied naively to each individual trace (red and blue) without being split, so the values are completely misaligned.At the very least, we should reject providing a list or colname to
opacitywhen splitting by color or faceting.Ideally, we should correctly split and apply the list to each color such that the correct opacity values are aligned with the correct points. I looked into it a bit and it's probably doable but a little complex due to some quirks in the
pxmachinery.