Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Jupyter notebooks for inline Retina Matplotlib figures

I want the effect of

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format='retina'

at the launch of all my Jupyter notebooks, but I can't figure out what the current approach is for accomplishing this. There are many answers here and elsewhere, but none that I can find seem to be up to date.

How do I accomplish the above in the current versions of Jupyter notebooks (but not IPython generally!): what settings should I apply where is the configuration file I should put them in?


I've tried

c.InteractiveShellApp.matplotlib = "inline"
c.InlineBackend.figure_formats = set(['retina'])

in

~/.jupyter/jupyter_notebook_config.py

but this has no effect.

like image 834
orome Avatar asked Apr 01 '16 15:04

orome


1 Answers

I have

c.IPKernelApp.matplotlib = 'inline'
c.InlineBackend.figure_format = 'retina'

in my ~/.ipython/profile_default/ipython_kernel_config.py.

like image 72
Shahar Avatar answered Nov 19 '22 13:11

Shahar