I've written a python module which generates an image from a bunch of values as plot. The module uses matplotlib and pandas for the generation of the image. Now I'm a bit in trouble accessing the image from inside DocAssemble to put the image into a docx template. Therefore I've some questions:
- The image will be saved within the module in
/usr/share/docassemble/files/image.png
. I don't think that this is the proper path to save files in DA. Where can I save such files to be accessed in the later interview?
plt.savefig("/usr/share/docassemble/files/image.png")
- What is the right way to implement the image from such a path into a docx document using DA YAML?
extract from da yml file
---
modules:
- .plot_file
[...]
---
code: |
plot_file(datapoints)