Example page

import numpy as np
from matplotlib import pyplot as plt

# these lines are only for helping improve the display
import matplotlib_inline.backend_inline
matplotlib_inline.backend_inline.set_matplotlib_formats('pdf', 'png')
plt.rcParams['figure.dpi']= 200
plt.rcParams['savefig.dpi'] = 200

from myst_nb import glue
nums = np.linspace(0, 10)

fig, ax = plt.subplots()
ax.plot(nums, nums)
plt.savefig('figure.png')
plt.show()
plt.close()

glue('fig', fig, display=False)
_images/page1_3_0.png
_images/page1_3_1.png

Fig. 1 This is a caption.

Example figure

Fig. 2 This is the same figure inserted as a Markdown figure with a saved image.