-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
PatchCollection edges incorrect when clip path is set #15946
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
Can be reproduced as far back as 1.5.3, and though mplcairo has different antialiasing, it does produce the correct result. It seems to have something to do with the single path optimization for |
the builtin vector backends also seem immune, so it's agg only. |
So obviously, if I force set There's an explanation of what the markers optimization is by @mdboom at #3626 (comment), though I don't really understand the benefit for things that are single paths anyway (as opposed to scatter, ticks, etc.) |
Seems reasonable to disable stamping for single paths, except that IIRC (it's been a while, though) I tried this and ticks (which are single paths for now -- they are drawn independently from one another, which as a side point is terrible performance-wise) look much better when snapped to integer pixels (basically "short" lines (i.e. ticks) look particularly bad when antialiased between two pixel rows). I guess it was pretty accidental that marker stamping helped with tick antialiasing, but heh. |
Looking at the test results for forcing |
I tried that out, and while it does work, it also breaks a few tests. I think those tests may be wrong, but we have to see which way we want to go there. This may take a bit more time to decide. |
Bug report
Bug summary
Cartopy has a mostly-superfluous
GeoAxes.background_patch
which I'm trying to convert to the standardAxes.patch
. By default, theAxes.patch
is aRectangle
, which triggers a fast-path to set a clip box instead of a clip path. However, since most map boundaries are non-square, the full clip path code is used instead. When doing so, this causes some strange artifacts.(Un)Fortunately, it can be reproduced with plain Matplotlib below.
Code for reproduction
Actual outcome
In the bottom row is a plain
PathPatch
, and the top row is aPatchCollection
containing the samePathPatch
. The left column shows the default clipping (to the clip box of theAxes
). The right column uses a clip path of a manually-specified 0-1 rectangle inAxes
space, so it should be equivalent.But the horizontal edges are either doubled over or the wrong width in the top-right case.
Expected outcome
All path edges should look the same.
Matplotlib version
print(matplotlib.get_backend())
): TkAgg (probably only the Agg bit is relevant)The text was updated successfully, but these errors were encountered: