Choosing a plotting backend

Inline plots


In [1]:
import numpy as np
import matplotlib.pyplot as plt

In [2]:
%matplotlib inline

In [3]:
plt.imshow(np.random.rand(10, 10), interpolation='none')

Exported figures

GUI toolkits


In [4]:
%matplotlib qt
plt.imshow(np.random.rand(10, 10), interpolation='none')

Dynamic inline plots


In [5]:
import matplotlib
matplotlib.use('nbagg')

In [6]:
plt.imshow(np.random.rand(10, 10), interpolation='none')
plt.show()

Web-based visualization


In [7]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import mpld3
mpld3.enable_notebook()

In [8]:
plt.imshow(np.random.rand(10, 10), interpolation='none')