Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
AddsCenteredAsinhNorm class to automatically center asinh-normaliz…#30691
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ed data around a specified value (typically zero). This is useful for diverging colormaps where symmetric scaling is desired.Users currently need to manually calculate and set symmetric vmin/vmax values when using `AsinhNorm` with diverging colormaps. This new class automates that process, similar to how `CenteredNorm` works for linear scaling. ## Changes - Added `CenteredAsinhNorm` class in `lib/matplotlib/colors.py` - Added type stubs in `lib/matplotlib/colors.pyi` - Added 11 comprehensive test cases in `lib/matplotlib/tests/test_colors.py` - Fully documented with NumPy-style docstrings - Bilingual comments for maintainabilityClosesmatplotlib#30679
timhoffm commentedOct 27, 2025
Thanks for the contribution. Would we conceptually also need a CenteredSymLogNorm? |
U-C4N commentedOct 27, 2025
Good question , but i think it could be useful for consistency but i do suggest we can start with CenteredAsinhNorm firstsince:
|
sidneymau commentedOct 28, 2025
Catching up as I just saw this linked to the issue I raised.
I agree that a |
timhoffm commentedOct 28, 2025
While I would like to not build separate centered versions of the norms, we'd need to carefully think through behavior and API implications. Some incomplete
|
…ed data around a specified value (typically zero). This is useful for diverging colormaps where symmetric scaling is desired.
Users currently need to manually calculate and set symmetric vmin/vmax values when using
AsinhNormwithdiverging colormaps. This new class automates that process, similar to how
CenteredNormworks for linearscaling.
Changes
CenteredAsinhNormclass inlib/matplotlib/colors.pylib/matplotlib/colors.pyilib/matplotlib/tests/test_colors.pyCloses#30679