-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Image being snapped erroneously #1591
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
Conversation
Based on the changes in the linked commit I changed the following lines from:
to
Attaining this was completely unscientific and all I know is that it "fixed" my plot. @mdboom any thoughts? |
The extra pixel is of course dependent on the size of the figure. I update your example above so it tries a bunch of different sizes, and indeed it fails on some of the sizes with |
I'll wait for Travis to run over this, but we should also add a unit test based on your example before merging. |
Wow.... Ok, there are loads of failures with that change. Do you want to look into those or would you like me to? |
I may not have a chance today or tomorrow -- the failures probably require a manual look -- it may be that we're actually improving them with this change and the reference files need to be updated -- (but I haven't looked at the results yet, so who knows...) |
Is this related to #800? |
They are somewhat related. I think we should at least investigate whether #800 resolves this issue. |
Having finally looked at the image differences, I think this is not the right solution (at least as it stands). It causes the clipping box to be larger than the axes box (in some cases) and the content bleeds over: And I think it's ultimately the lack of an axes box in the example of this issue that reveals the problem. I'm going to look at #800, and also investigate some other approaches for this issue. |
… (see there for further discussion) and matplotlib#1591. This, unlike matplotlib#800, doesn't change the snapping in a fundamental way, but it does help with text/image/marker alignment of snapped and non-snapped objects.
Yep. Thanks @mdboom. |
Since 1262326 implemented by @mdboom the following example results in a figure which has a 1 pixel border around left and bottom edges in the resultant image:
Notice the green 1px border on the bottom and right of the output.
The problem is limited to the Agg backend and the "none" image interpolation scheme.
With a bit of refinement, this example should be turned into a test once we have a fix for this.