Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc]: Improve "Creating Colormaps" tutorial #21735

Open
timhoffm opened this issue Nov 24, 2021 · 2 comments
Open

[Doc]: Improve "Creating Colormaps" tutorial #21735

timhoffm opened this issue Nov 24, 2021 · 2 comments

Comments

@timhoffm
Copy link
Member

timhoffm commented Nov 24, 2021

Documentation Link

https://matplotlib.org/devdocs/tutorials/colors/colormap-manipulation.html

Problem

  • Passing a lut parameter should be a side note, not be used everywhere in the tutorial.
  • "Getting colormaps and accessing their values" is slightly off. - (Re)move or rephrase tutorial title and/or section title
  • Introductory paragraph on "ListedColormap and LinearSegmentedColormap" is wordy and unspecific without conveying much information.
  • ...

Suggested improvement

I think we need essentially a complete rewrite / reorg.

Matplotlib Version

3.5.0

@jklymak
Copy link
Member

jklymak commented Nov 24, 2021

Documentation Link

https://matplotlib.org/devdocs/tutorials/colors/colormap-manipulation.html

Problem

  • Passing a lut parameter should be a side note, not be used everywhere in the tutorial.

Perhaps I'm misunderstanding your complaint here? The way you create a colormap in Matlab and most other scientific computing packages that I know of is very simple - you pass an RGB lookup table. Most colormaps available publicly from other software are created and shared via the lookup table. Performing carpentry on a lookup table is the same as performing carpentry on a numpy array, so it is very easy. Finally, all the recent colormaps (viridis, magma, inferno, plasma, twilight, turbo) are listed colormaps, and so far as I know the tools to create perceptually uniform colormaps all create lookup tables. So passing a lookup table, which was previously completely absent from the documentation, was the point of the tutorial, not a sidenote.

Conversely LinearSegmentedColormaps are very elegant, and not digitized, but almost impossible to manipulate, and completely Matplotlib specific. While we have a lot of historic colormaps written this way, it seems to me most users will not create or perform carpentry on colormaps this way.

  • "Getting colormaps and accessing their values" is slightly off. - (Re)move or rephrase tutorial title and/or section title
  • Introductory paragraph on "ListedColormap and LinearSegmentedColormap" is wordy and unspecific without conveying much information.

Certainly this could be tightened, but the introduction is necessary for folks who don't know what those concepts are...

@timhoffm
Copy link
Member Author

Perhaps I'm misunderstanding your complaint here?

Yes, will clarify later.

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

No branches or pull requests

2 participants