Skip to content

DOC: briefly describe norms in general in norm guide - #32231

Draft
story645 wants to merge 1 commit into
matplotlib:mainfrom
story645:norm-explain
Draft

DOC: briefly describe norms in general in norm guide#32231
story645 wants to merge 1 commit into
matplotlib:mainfrom
story645:norm-explain

Conversation

@story645

Copy link
Copy Markdown
Member

PR summary

Added a sentence and moved things around to briefly explain what norms are/do before getting into examples.

AI Disclosure

nope

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • Plotting related features are demonstrated in an example
  • New features and API changes have release notes
  • Documentation complies with general and docstring guidelines

@github-actions github-actions Bot added the Documentation: user guide files in galleries/users_explain or doc/users label Aug 19, 2026
Objects that use colormaps by default linearly map the colors in the
colormap from data values *vmin* to *vmax*. For example::
Normalization objects map data values into the colormap indexing range, and this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall topic is still mapping data to color. IMHO we should start the introduction there and not with the Normalization part only. e.g.

Objects that use colormaps map their data to color values in a two-step process. First, Normalization objects map data values to normalized values. The transformations can be linear or non-linear, but the transformation parameters are typically chosen so that relevant values are mapped to the interval [0, 1]. The colormap then maps the values in the interval [0, 1] to actual colors. Values below 0 / above 1 are mapped to the "under" / "over" values of the colormap. Hence, to spread the relevant data range to the full colormap, the norm should map that data range to [0, 1].

@story645 story645 Aug 19, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Objects that use colormaps map their data to color values in a two-step process.

The point of colorizer is that theoretically this isn't totally true anymore, but I agree w/ your broader point of easing more into normalization rather than starting there.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can and it’s probably a good idea to mention colorizer. Note that it’s only a formalization of the norm+colorbar concept, not an abstraction (which would allow arbitrary mapping. From the module docstring:

The Colorizer class which handles the data to color pipeline via a normalization and a colormap.

@story645 story645 Aug 20, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an abstraction (which would allow arbitrary mapping

Discrete colorizer would be the full abstraction (in that any norm involved would be purely implementation detail of data value -> listedcolormap index -> color while most norms are data value -norm -> cmap interval range value -cmap-> cmap array index) but yeah let me think on how to write this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently don’t have that. The most fundamental class is Colorizer, which is built using norm+cmap. So I would not bother with further abstractions until we have them.

@story645
story645 marked this pull request as draft August 19, 2026 23:57
@jklymak

jklymak commented Aug 20, 2026

Copy link
Copy Markdown
Member

I think going from concrete and the default most people will already be familiar with to the more abstract is more useful than starting with the abstraction. I think that is what the original did, though no doubt it could be better worded.

@story645

story645 commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

I think going from concrete and the default most people will already be familiar with to the more abstract is more useful than starting with the abstraction

I think the document should signpost/introduce what the whole document is about before jumping into the specifics. My experience broadly is that it helps orient people to tell them what I'm showing them examples of before I show them examples.

ETA: Also it's just defining terms before they get used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation: user guide files in galleries/users_explain or doc/users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants