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]: Text in the colormap normalization gallery doesn't match the code #27727

Closed
igurin-invn opened this issue Feb 1, 2024 · 3 comments · Fixed by #27729
Closed

[Doc]: Text in the colormap normalization gallery doesn't match the code #27727

igurin-invn opened this issue Feb 1, 2024 · 3 comments · Fixed by #27729

Comments

@igurin-invn
Copy link
Contributor

Documentation Link

https://matplotlib.org/stable/gallery/images_contours_and_fields/colormap_normalizations.html#sphx-glr-gallery-images-contours-and-fields-colormap-normalizations-py

Problem

SymLogNorm: two humps, one negative and one positive, The positive with 5-times the amplitude. Linearly, you cannot see detail in the negative hump. Here we logarithmically scale the positive and negative data separately.

  1. The equation Z = 5 * np.exp(-X**2 - Y**2) describes a simple Gaussian bell curve in two dimensions. There's no second hump.
  2. There are no negative data. A Gaussian is always positive.

Custom Norm: An example with a customized normalization. This one uses the example above, and normalizes the negative data differently from the positive.

  1. The equation is not the same as the previous one! This one does have the two humps promised above, but they have the same amplitude.
  2. The negative and positive data are normalized symmetrically. The top and bottom plots look almost the same.

Suggested improvement

It's a gallery example, so you can do whatever you want, just please make it consistent.

@QuLogic
Copy link
Member

QuLogic commented Feb 1, 2024

It looks like this was probably accidentally changed with 32a2f79

@story645
Copy link
Member

story645 commented Feb 1, 2024

It's a gallery example, so you can do whatever you want, just please make it consistent.

Any preference?

@igurin-invn
Copy link
Contributor Author

I think a function like 5*np.exp(-X**2 - Y**2) - np.exp(-(X-1)**2 - (Y-1)**2) ought to satisfy the descriptions for both cases. I'll let the experts in the room verify that the colormap normalizations work as advertised.

@QuLogic QuLogic added this to the v3.9.0 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants