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)