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/0a1e1f1a3c1181163841de9a55bc019f7d9f8fec8a78437f33a302f88b237691.png