An orphaned notebook#
This defines a variable that we’ll re-use in another notebook.
from myst_nb import glue
glue("var_text", "My orphaned variable!")
glue("var_float", 1.0 / 3.0)
'My orphaned variable!'
0.3333333333333333
We can also glue and image.
import numpy as np
import matplotlib.pyplot as plt
data = np.random.rand(3, 100) * 100
fig, ax = plt.subplots()
ax.scatter(*data, c=data[2])
glue("var_img", fig, display=False)