-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Possible issue in hexbin using weights #20877
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
Comments
Try turning mincount to 1e-6 or something else suitably small, and I think you will figure out the issue. I'll close because I don't think there is an error here. Please discuss at https://discourse.matplotlib.org if you would like more explanation. Thanks! |
Thanks for your answer ! Although, I believe there might still be something more to say @jklymak. From the hexbin documentation it is said :
Hence the mincnt should, to my understanding of the docstring, not depend on any of the variables (not |
Right maybe the documentation could be clearer. Apparently when c is provided it modifies the count (or weight) of each data point. In this case you are making those counts be less than 1, and falling below the threshold. |
OK if I pick this one up? I can see how an improvement to the mincnt part of the docstring would help here. |
@RebeccaWPerry we don't assign PRs, so if an issue doesn't have a linked PR, anyone is welcome to work on it. If there is a linked PR, please try and work in the confines of that PR. |
I looked into this more and realized it wasn't actually a documentation-only issue. I included more details in PR #21381, but for for the same of completeness here is an example that shows even when "scaling" by 1 and reducing with sum the bug persists.
|
With v3.8.0 and So I think this is fixed, probably by #26113. |
I am facing a problem in matplotlib, using hexbin with weights (argument C=).
When I am filling the C argument, not only the ouput color changes but also the shape. Here is a very simple code snippet reproducing the behavior:
And the corresponding output:

To my understanding, as the x and y coordinates of the points are identical, only the color on the two plots should change. However, it is clearly not the case. Is it another parameter that is changing without me being aware of ? Is C not doing what I expect it to do ?
Thanks in advance for any help !
The text was updated successfully, but these errors were encountered: