Skip to content

Store predefined group colors as dict? #596

@ivirshup

Description

@ivirshup

Could we change colors for groups from being defined by an array of colors to being a dict mapping from the relevant key/ category to the color? I would find this more intuitive, and much easier to modify. Plus tools like seaborn can accept dicts directly as a palette:

import seaborn as sns

iris = sns.load_dataset("iris")
g = sns.FacetGrid(
    iris, 
    row="species", 
    hue="species", 
    palette={"setosa": "red", "versicolor": "green", "virginica": "blue"}
)
g.map(sns.kdeplot, "sepal_width").show()

example

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions