jupyter / help

:sparkles: Need some help or have some questions? Please visit our Discourse page.
https://discourse.jupyter.org
291 stars 97 forks source link

Low res images while exporting to pdf #415

Open adivijaykumar opened 6 years ago

adivijaykumar commented 6 years ago

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!

minrk commented 5 years ago

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.

for example