-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
radius modification in contains_point function when linewidth is specified #19807
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
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
... and friends. closes matplotlib#19807
... and friends. closes matplotlib#19807
https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch.contains_point The input to I opened a PR to document the logic to pick the default radius, but I think there is still a latent bug with screen space being in pixels, but the linewidth being in points so we are (in all cases with reasonable dpi) not extending the range far enough. I am not sure we know enough about the source / target of the transforms to be able to reliably fix that problem. |
... and friends. closes matplotlib#19807
... and friends. closes matplotlib#19807 Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
…atplotlib#27462) ... and friends. closes matplotlib#19807 Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
…atplotlib#27462) ... and friends. closes matplotlib#19807 Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Bug report
Bug summary
When specifyng
linewidth
in a patch object and then using thecontains_point
function the radius of this is set tolinewidth
and returns inconsistent results. This is somewhat documented here but I think this is an unwanted behaviour sincelinewidth
is specified in points and not in data coordinates, while thecontains_point
function gonna search for those data points enclosed between the border of the path and half thelinewidth
.Code for reproduction
Actual outcome
Expected outcome
The expected output is
False
in both cases since the point(0, 1.5)
is neither in the patch (Circle in this case) neither on the line of the edge. I propose to multiply_radius = self.get_linewidth()
in the_process_radius
function in the source code by a corrective factor.Matplotlib version
Installation from pip
The text was updated successfully, but these errors were encountered: