Static Matplotlib Figures

Static Matplotlib Figures#

Specify the static Jupyter matplotlib integration. This must be run first, before any figures are created.

This disables any interactivity, displaying only a PNG image of the figure in the Jupyter Lab view.

%matplotlib inline
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4])
[<matplotlib.lines.Line2D at 0x7f710269dbd0>]
../../_images/6c22d062e895d96fba58687696ba7ad092d72165d479b59048b67b0e047ad956.png
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax.plot([1, 4, 9, 16])
[<matplotlib.lines.Line2D at 0x7f70fa3791d0>]
../../_images/68a4bc93634744d71bbe4d98a5ac5e7c3b7500b6bd7e2daaed49811894e2d7be.png