mwaskom / seaborn

Statistical data visualization in Python
https://seaborn.pydata.org
BSD 3-Clause "New" or "Revised" License
12.6k stars 1.93k forks source link

seaborn objects directly specifying color #3759

Closed SamKG closed 2 months ago

SamKG commented 2 months ago

I'm wondering if there's any way to directly specify the color of every single datapoint via seaborn objects. Currently, specifying the color variable groups the values and assigning a separate color to each group

I was wondering if instead there was a way to manually assign colors, e.g. via a list of the same size as the input data.

mwaskom commented 2 months ago

It sounds like you are looking for

Or pass None to use an “identity” scale, which treats data values as literally encoding visual properties.

From https://seaborn.pydata.org/generated/seaborn.objects.Plot.scale.html

SamKG commented 2 months ago

Thanks, this is exactly what I was looking for!