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 0x7f8da0284550>]
../../_images/7d1069fa6ee4dbffca3a6a3ebfe509a8bd74125900789a0eb758cc763fd985dd.png
import matplotlib.pyplot as plt

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