help
help copied to clipboard
Low res images while exporting to pdf
trafficstars
Hi,
I am working with the following notebook https://gist.github.com/adivijaykumar/bc3aa0b10af6cf84ee8c2a4e21443769.
The presentation style file sets figure.dpi : 400 and savefig.dpi : 400.
But still, I get very low res images when I export the notebook to pdf. Increasing the dpi does not help.
Please suggest a solution for this. Thanks in advance!
You might want to tell matplotlib to export PDF-native renders as well as the PNG used in the browser:
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('png2x', 'pdf')
Then you can have 2x pngs in the browser and nice vector pdfs in your pdf export. It will make your figures take up quite a bit of space in the notebook, though.