My problem is simple: I have a PDF figure I would like to show alongside the results of some data analysis. Yet even an extensive Google search did not bring up a way to load and show a PDF in a figure (I only found the standard results for raster images like JPG or PNG).
Thanks in advance!
I don't think Matplotlib supports plotting imported vector graphics on its own as of today.
The easiest approach would probably be to save your figure generated in Matplotlib to SVG, convert your PDF to svg (pdf2svg works well most of the time) and the combine the two SVGs in a second step, for instance using svg_utils. Note that you can do all this in a single script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With