Check matplotlib backendΒΆ

Links: notebook, html ., PDF, python, slides ., presentation .

%matplotlib inline
import matplotlib
matplotlib.get_backend()
'module://ipykernel.pylab.backend_inline'
import pyquickhelper
import matplotlib
matplotlib.get_backend()
'module://ipykernel.pylab.backend_inline'

The following instruction tends to change matplotlib backend, we just check it does not happen. If this changes, check you did not import a module which import matplotlib or did run the following:

1
2
from matplotlib.sphinxext.plot_directive import setup as setup_plot
from matplotlib.sphinxext.only_directives import setup as setup_only

The backend might change in that case to 'agg' and graphs will not be displayed into the notebook.

%load_ext pyquickhelper
import matplotlib
matplotlib.get_backend()
'module://ipykernel.pylab.backend_inline'
%matplotlib inline
import matplotlib
matplotlib.get_backend()
'module://ipykernel.pylab.backend_inline'