Make your SciPy presentation in Quarto

Isabella Velásquez
Charlotte Wickham

2026-07-14

Slides are just Markdown and code:

  • Write your narrative in Markdown
  • Weave in Python code and its output
  • Render it all to one reproducible file

Features for showing code

Add Python code cells

from plotnine import *
from plotnine.data import anscombe_quartet

Code output is included

anscombe_quartet.head()
dataset x y
0 I 10 8.04
1 I 8 6.95
2 I 13 7.58
3 I 9 8.81
4 I 11 8.33

You can show code without running it

%view opens the data in Positron’s Data Explorer:

%view anscombe_quartet

Highlight lines as you talk

(
    anscombe_quartet
    .groupby("dataset")[["x", "y"]]
    .apply(lambda g: g["x"].corr(g["y"]))
    .round(2).to_frame("correlation")
)
correlation
dataset
I 0.82
II 0.82
III 0.82
IV 0.82

Send big output to its own slide

(
    ggplot(anscombe_quartet, aes("x", "y"))
    + geom_point(color="sienna", fill="orange", size=3)
    + geom_smooth(method="lm", se=False, fullrange=True,
                  color="steelblue", size=1)
    + facet_wrap("dataset")
    + labs(title="Anscombe’s Quartet")
    + scale_y_continuous(breaks=(4, 8, 12))
    + coord_fixed(xlim=(3, 22), ylim=(2, 14))
    + theme_tufte(base_family="Futura", base_size=16)
    + theme(
        axis_line=element_line(color="#4d4d4d"),
        axis_ticks_major=element_line(color="#00000000"),
        axis_title=element_blank(),
        panel_spacing=0.09,
    )
)

Send big output to its own slide

Label code with filenames

Terminal
pip install pandas


script.py
import pandas as pd