An orphaned notebook

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)
../_images/899dadca3f1f23bcde2fd9ad9dc23d597a3f6e6a26e230e4640e0aad6d65fe56.png