Skip to content

Caption the figures in prob_dist and observed_distributions - #816

Merged
jstac merged 1 commit into
mainfrom
caption-sweep
Aug 3, 2026
Merged

Caption the figures in prob_dist and observed_distributions#816
jstac merged 1 commit into
mainfrom
caption-sweep

Conversation

@jstac

@jstac jstac commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The manual asks every code-generated figure to carry a caption via mystnb metadata. These two lectures were well short of that:

lecture figures captioned before after
prob_dist 20 3 19
observed_distributions 20 0 19

The observed_distributions gap is an oversight in #811 — I wrote that lecture without any captions at all.

35 captions added, with fig: names for numref, following the manual's rules: sentence case, six words or fewer, descriptive names.

Two figures deliberately left bare

One in each lecture, both inside solution directives. The manual is explicit that captions there wrap the image in a LaTeX float and break the PDF build with Not in outer par mode, so those cells stay uncaptioned.

A bug found while captioning

The CDF figure in the lognormal section was built from scipy.stats.norm:

for σ in σ_vals:
    u = scipy.stats.norm(μ, σ)      # <- normal, under a lognormal heading

So it had been drawing normal CDFs all along. It also pinned $\mu = 1$ and looped over $\sigma$ alone, while the density figure directly above it varies both parameters — so the two figures did not correspond.

It now uses lognorm over the same $(\mu, \sigma)$ pairs as the density figure, making them a matched pair, and the curves start at zero as a distribution on the positive half-line should.

I found this because a caption forced the question of what the figure actually showed. Fixing it changes one existing figure's output, which is why it is called out here rather than buried in a mechanical sweep.

Both lectures execute end to end.

🤖 Generated with Claude Code

The manual asks every code-generated figure to carry a caption via mystnb
metadata. prob_dist had 3 of 20 and observed_distributions none of 20, the
latter being an oversight in #811.

Adds 35 captions with fig: names for numref, following the manual: sentence
case, six words or fewer, descriptive names.

Two figures are deliberately left bare, one in each lecture. Both sit inside
solution directives, where a caption wraps the image in a LaTeX float and
breaks the PDF build with "Not in outer par mode".

Also fixes a bug found while captioning. The CDF figure in the lognormal
section was built from scipy.stats.norm rather than scipy.stats.lognorm, so
it had been drawing normal CDFs under a lognormal heading, and it looped over
sigma alone with mu pinned to 1 while the density figure above it varied
both. It now uses lognorm over the same (mu, sigma) pairs as that figure, so
the two are a matched pair and the curves start at zero as a distribution on
the positive half-line should.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit 72f0afc
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6a70e9414ec3e60008ad1365
😎 Deploy Preview https://deploy-preview-816--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request August 3, 2026 19:24 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 3, 2026 19:26 Inactive
@jstac
jstac merged commit c8587ed into main Aug 3, 2026
7 checks passed
@jstac
jstac deleted the caption-sweep branch August 3, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant