I typically use plt.rcParams['figure.dpi'] = 300
to increase the resolution of Matplotlib plots in my Jupyter notebooks.
However, this setting does not seem to work with Jupyter Books.
Here are reproducible steps:
- Create a Jupyter Book template with
jupyter-book create mynewbook
- To
mynewbook/notebooks.ipynb
, add a code cell withrcParams['figure.dpi'] = 600
just before the plot - Build this Jupyter Book with
jupyter-book build --builder pdflatex mynewbook
The figure in notebooks.ipynb
remains the default resolution (72 dpi?) instead of 600 dpi, even though the in-notebook resolution is 600 dpi. How can I increase the resolution of Matplotlib (and seaborn) plots in Jupyter Books?