-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Line2D can snap incorrectly and request snap(x)(y) parameters #19054
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 is a numeric issue. If you replace the 801.5 y-values by 801.50000000001 everything looks right, i.e.
I'm not clear if we can do anything about this. |
It's not clear we can do anything about it? The point of snapping is that there is a critical value below which everything gets snapped to one pixel row, and above which everything gets snapped to the next pixel row... |
xref #8265 for discussion and some code on |
Please unsuscribe me , from all the matplotlib mails.
Thanks
Enviado desde Correo para Windows 10
De: Thomas A Caswell
Enviado: martes, 29 de diciembre de 2020 14:25
Para: matplotlib/matplotlib
CC: Subscribed
Asunto: Re: [matplotlib/matplotlib] Line2D can snap incorrectly and request snap(x)(y) parameters (#19054)
xref #8265 for discussion and some code on floor vs round.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
…--
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus
|
I'm going to close, in the same spirit as #18945. Numbers right on the border of 0.5 are going to flop between either side arbitrarily, based on round off error. @Ernesto1971 we can't change your subscription status on GitHub. You have to do that yourself. |
@timhoffm I think this is more than a numeric issue. @anntzer I found the thresholds and there are still some unanswered questions... The below thresholds are between the bottom/left pixel row/column and middle pixel row/column of the original blue cross for the x and y axis: x (offsetting the vertical artists): y (offsetting the horizontal artists): @jklymak Even if we ignore the exact transition points (<= or <), bizarre snapping still occurs:
|
Bug report
Bug summary
Axes.plot
produces thin lines (1, 3, ... px) which may snap incorrectly relative toRectangle
s depending on thedpi
andAxes
position, in other words, the width of the left and bottom margins. In such cases, non-snapped lines achieve the desired outcome.Code for reproduction
The
Axes
relative position of (0.09, 0.1) is chosen on purpose so that the left margin is 0.09 * 10 in * 155 dpi = 139.5 px and the bottom one is 155 px. Also note that theAxis
are scaled to be 1 pixel : 1 unit.Actual outcome
Zoom in to view individual pixels...
Expected outcome
That the lime line snaps correctly in the middle of the blue
Rectangle
s. Note how the horizontal non-snapped red line works as desired.Feature request
To implement something equivalent to
snapx
andsnapy
followingscalex
andscaley
trend. #15595 might change this trend though. This feature could be used to work around this issue, but I think the solutions should be independent. Will split this request into another issue if it's welcomed.Matplotlib version
Python installed via official installer. Matplotlib installed via pip.
The text was updated successfully, but these errors were encountered: