pip install nb_thumbfrom nb_thumb import nb2thumbnb2thumb(nb_path='test_nbs/geom_col.ipynb',
label='two_variable_bar_plot',
size=(200,200))This will show a gallery of plots from notebooks.
from nb_thumb import galleryUse output: asis
When using
nb_thumb.galleryyou should always set the Quarto directive#|output: asisso that the markdown is rendered correctly in quarto.See raw output for more information.
plots = \
[dict(nb_path= 'test_nbs/geom_col.ipynb', label='two_variable_bar_plot'),
dict(nb_path='test_nbs/PlotnineAnimation.ipynb', label='spiral'),
dict(nb_path='test_nbs/geom_density.ipynb', label='density_curve'),
dict(nb_path='test_nbs/geom_map.ipynb', label='map'),
dict(nb_path='test_nbs/geom_segment.ipynb', label='ranges'),
dict(nb_path='test_nbs/geom_segment.ipynb', label='rank')]#|output: asis
print(gallery(plots))For more information and examples, see the docs.