-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
savefig PDF output - incorrect annotation location #10844
Comments
Thanks for cross referencing this for me IOBE. I have not submitted a bug report before... |
This is because the offset you get is with the default DPI, but PDF always uses 72. You can workaround it by explicitly setting the DPI with The correct fix is to somehow get |
Based on a quick look at the code, I don't see where the problem is coming from. It looks like everything is being updated with every draw, using the renderer in effect at draw-time. |
Its definitely a dpi issue. If I change the x,y by |
#10910 fixes this, hopefully in a way that doesn't break anything else... |
Closing, since #10910 is merged. Feel free to re-open or comment if this is still an issue. |
cleared the milestone as this was actually fixed in 3.0 |
Bug report
Annotation beneath legend is positioned correctly on screen and with PNG output generated by savefig(). Annotation location is incorrect for PDF output of savefig()
Code for reproduction
Actual outcome
The code produces an on-screen plot with two lines, a legend, and the annotation string 'info_string' located beneath the legend and aligned to the right hand edge of the legend box.
The code also generates two files;
The PNG output is here, which is what both files should look like.
The incorrect PDF output is here.
If the length of the annotation string in increased (eg. to 'extra_information_string'), the first few characters become visible in the top right corner of the PDF file.
Expected outcome
The PDF file should show the annotation in the same location as the on screen plot and the PNG file.
Software Versions
print(matplotlib.get_backend())
): Qt5AggMatplotlib and python were installed using conda from the default channel.
The problem was observed when running the above code as a script from the command line.
The text was updated successfully, but these errors were encountered: