Store predefined group colors as dict?
Open
Nobody has claimed this yet.
Area - Plotting 🌺
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
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()

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing group-color definitions and every place that consumes them, then check how the current array order relates to group keys or categories. Done means colors are represented by a key-to-color dict throughout the relevant plotting path, with tests or examples covering the new form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100