Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Summary
Currently the data→norm→color pipeline involves two files:
colors.py
:- Utility functions for working with colors
Colormap
and subclasses ofColormap
Normalize
and subclasses ofNormalize
cm.py
:- The colormap registry
ScalarMappable
(holds data, norm and colormap)
In this structure, each file contains multiple parts of the pipeline, and it is not intuitive which part of the pipeline is located where.
With PR#28658 we are creatingcolorizer.py
and the newColorizer
object to improve the data→norm→color pipeline.
This has the added benefit that it greatly simplifiescm.py
, which now only contains the colormap registry (and ScalarMappable for compatibility reasons).
Proposed fix
This issue suggests moving the norms to a separate file in order to clean upcolors.py
. This, together with#28658 would lead to the following structure:
colors.py
:- Utility functions for working with colors
Colormap
and subclasses ofColormap
norms.py
Normalize
and subclasses ofNormalize
cm.py
:- The colormap registry
colorizer.py
Colorizer
(handles the data→norm→color pipeline)
With this structure, each file only contains a single part of the pipeline.
This issue came up because I was looking to implement multivariate color mapping (see issue#14168, and PRs#28454,#28658, [#28428]) , and for this we will need at least one more norm (i.e.MultiNorm
).