-
Notifications
You must be signed in to change notification settings - Fork 264
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
Adding SVG images from matplotlib #446
Comments
Good news! I tested your code using the latest, unreleased, version 2.5.5 and it produced this PDF file that seems perfectly fine: This is thanks to the work of @RedShy in #419 🙌👏👏🏼🙏 I'm planning to perform a new release once the 2 PRs currently open are merged,
Does that solves your issue? |
I had already been wondering if the svg output of mathplotlib would be a working replacement for the currently documented way of using image files.
The graph as such looks ok, but the character placement in the axis labelling is rather wonky. Added: |
Agreed. Could you please submit a PR? Also, I think we should include @vicmayrink recipe as part of our documentation, |
Given that After looking at the SVG content, it seems like all text elements are in fact rendered as paths. We need to dig a bit deeper to understand what is missing in our code supporting SVG. |
I have found a fix in #448 The resulting PDF is a lot prettier: doc-with-svg.pdf |
I also added the recipe in the documentation in 304685: @vicmayrink : can we close this issue or do you have any other question/request regarding the subject? |
Very cool! (SVG is really a tricky beast...) Using SVG output from mathplotlib should result in much smaller (and crisper) PDFs in most cases so we clearly have a winner here! |
Thank you @gmischler 😊 Closing this now |
The fix to support |
Hello there! Thanks for the community members who develop and support fpdf2, it has been a handful tool generate analytical reports.
I'm using
matplotlib
to save figures in SVG format for better quality. Find below a sample code:The result, however, was not actually what I was expecting: a big black box. (output pdf is here)
I noticed that fpdf2 does not support some SVG features (list of unsupported features). Then, I'm wondering if outputs from
matplotlib
contains any feature that is not supported by FPDF2.Obs.: I would guess that it would be simpler to save the figure in pdf format (rather than svg). This issue is actually a suggestion from this discussion.
The text was updated successfully, but these errors were encountered: