Skip to content

Don't add 1 to all hexbin data when using log norm #21038

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

Closed
wants to merge 1 commit into from

Conversation

dstansby
Copy link
Member

PR Summary

This seems very wrong - it means that every bin that doesn't actually have a data point turns up with a value of 1, and all other bins have a value of 1 added to them. We handle the case where the bin value = 0 and a log scale fine by just not showing the bin.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • 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).

@jklymak
Copy link
Member

jklymak commented Sep 10, 2021

What is the git blame for that? It'd be interesting to see the reasoning.

@anntzer
Copy link
Contributor

anntzer commented Sep 10, 2021

This came in in 5f8a88a back in 2010, and I guess logzero handling was more iffy back then.
I agree that the current behavior is undesirable.
Some tests need to be updated, though.

@dstansby
Copy link
Member Author

It goes all the way back to 2010: 5f8a88a. I'm not sure what the motivation for it was, but perhaps handling zero values on a log norm didn't work as well back then?

@dstansby
Copy link
Member Author

I'm closing this in favour of #21039 which has more fixes, to avoid changing a test image twice.

@dstansby dstansby closed this Sep 10, 2021
@dstansby dstansby deleted the hexbin-log branch September 10, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants