Skip to content

Fix _g_sig_digits for value<0 and delta=0.#23111

Merged
timhoffm merged 1 commit intomatplotlib:mainfrom
anntzer:gsg
May 23, 2022
Merged

Fix _g_sig_digits for value<0 and delta=0.#23111
timhoffm merged 1 commit intomatplotlib:mainfrom
anntzer:gsg

Conversation

@anntzer
Copy link
Contributor

@anntzer anntzer commented May 23, 2022

np.spacing can return negative values, so we need an abs().

Closes #23108.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

np.spacing can return negative values, so we need an abs().
@anntzer anntzer added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: images labels May 23, 2022
@anntzer anntzer added this to the v3.5.3 milestone May 23, 2022
@timhoffm timhoffm merged commit a05b6fc into matplotlib:main May 23, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request May 23, 2022
@anntzer anntzer deleted the gsg branch May 23, 2022 19:02
timhoffm added a commit that referenced this pull request May 23, 2022
…111-on-v3.5.x

Backport PR #23111 on branch v3.5.x (Fix _g_sig_digits for value<0 and delta=0.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. topic: images

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Imshow with all negative values leads to math domain errors.

3 participants