Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vector graphics in figures #1658

Open
warnerjon12 opened this issue Oct 15, 2021 · 2 comments
Open

Support vector graphics in figures #1658

warnerjon12 opened this issue Oct 15, 2021 · 2 comments

Comments

@warnerjon12
Copy link

Figures created using matplotlib.pyplot are saved as png files when exporting. These scaled image files look unprofessional in a pdf output.

For pdf and latex output, it would be better save as a pdf file. Then the axis labels and such are saved using vector graphics so that the resulting file is both smaller and more professional.

@mgeier
Copy link
Contributor

mgeier commented Oct 15, 2021

PNG output is indeed the default, but you can select other output formats.

I've collected my findings in https://nbviewer.org/github/mgeier/python-audio/blob/master/plotting/matplotlib-inline-defaults.ipynb, but the TL;DR is:

Add this:

c.InlineBackend.figure_formats = {'svg', 'pdf'}

... to your ipython_kernel_config.py.

@t-makaro
Copy link
Contributor

I believe we do support SVG outputs with the svg2pdf preprocessor. Enabling SVG out from matplitlib is not an nbconvert issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants