python-docx-template icon indicating copy to clipboard operation
python-docx-template copied to clipboard

How to add vector (from matplotlib) graphics?

Open richard-moss opened this issue 6 years ago • 1 comments

Hi all,

great package! I've been looking for something like this for a week or so.

I was wondering what's the best way (or is there a way?) of including graphs produced by matplotlib as vector graphics (rather than bitmap like png or jpg)?

I want to put together some reports using the module, and include some graphs. I can include them fine right now using InlineImage() if I save them as jpg or png.

However due to the size impact on the resulting file (and poor resolution if printing) I'd prefer to do that in a vector format (svg, or pdf?).

I tried both pdf and svg with InlineImage() and it failed (I read issue #651 from python-docx about SVG support in python-docx).

So I was wondering is it possible, and how to go about, including matplotlib plots in a vector form?

thanks, Richard

richard-moss avatar Dec 27 '19 21:12 richard-moss

This has to be developped : mark this as enhancement

elapouya avatar Dec 28 '19 16:12 elapouya