pydata / pydata/xarray

Support for a coloarmap dictionary

Open
#8,151 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

Is your feature request related to a problem?

When I plot multiple lines using xarray.plot.line(), I would like xarray to be able to get the colors from a dictionary and use that for the color of the lines.

Describe the solution you'd like

There are 2 functionalities that can solve this problem

  1. Add an argument that takes a dictionary and used the colors provided in the dictionary if the corresponding labels exist.
  2. Make it possible to add a colormap dictionary to attributes and xarray.plot uses it whenever a color corresponding to the dimension exists.
Describe alternatives you've considered

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading xarray.plot.line() and the surrounding plotting documentation to understand how line labels and colors are currently selected. Clarify whether the dictionary should be a plotting argument or an attribute before implementing support, then verify that matching labels receive the requested colors and that existing plotting behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.