Skip to content

[ak2, ak_aiyagari, two_computation] Add figure captions and lw=2 - #1081

Open
mmcky wants to merge 2 commits into
mainfrom
style-figures-1080
Open

mmcky wants to merge 2 commits into
mainfrom
style-figures-1080

Conversation

@mmcky

@mmcky mmcky commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Addresses #1080, the figure follow-ups from the style pass on #1078.

Captions. Every code-generated figure in the main text of the three lectures now carries mystnb: figure: caption metadata with a name, so each renders as "Fig N. caption" and can be referenced with numref. Figures inside exercise and solution directives are deliberately left uncaptioned, since a caption wraps the image in a LaTeX float and breaks the PDF build.

Lecture Captions added
ak2 8
ak_aiyagari 7
two_computation 9

Line widths. lw=2 is now set on every line chart in ak2 and ak_aiyagari, including the plot() methods of ClosedFormTrans and AK2 and the verbose plots in path_iteration, and on the four opening figures of two_computation that lacked it. Dashed reference lines such as the 45-degree line keep their default width.

No code logic changes. One thing worth a look in the preview: the ak2.simulate(..., verbose=True) cell in ak2 and the two path_iteration(..., verbose=True) cells in ak_aiyagari print a convergence line as well as a figure, so their captions sit under a mixed output.

🤖 Generated with Claude Code

Give every code-generated figure in the main text a mystnb caption
and name, and set lw=2 on line charts, per the figures page of the
style guide. Figures inside exercises and solutions are left
uncaptioned so the PDF build is unaffected.

See #1080

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mmcky
mmcky requested review from HumphreyYang and a balanced review from Copilot October 9, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Three captioned cells render a print plus a figure under the caption float, and verifying the resulting HTML/PDF figure output requires a full lecture build and human preview that cannot be done here.

0 open findings

What changed in this PR

This PR applies two conventions from the QuantEcon style guide's figures page to three lectures (ak2, ak_aiyagari, two_computation), following up on the style pass in #1078 and addressing #1080. It adds mystnb: figure: caption metadata (each with a unique name for numref referencing) to code-generated figures in the main text, and sets lw=2 on line charts. There are no code logic changes.

Changes:

  • Added figure captions with unique name labels to 24 code cells across the three lectures (ak2: 8, ak_aiyagari: 7, two_computation: 9), all placed on {code-cell} directives in main text and kept out of exercise/solution directives to avoid LaTeX float PDF build issues.
  • Set lw=2 on line charts (including the plot() methods of ClosedFormTrans/AK2, verbose iteration plots, and the opening two_computation figures), while deliberately leaving dashed reference lines (45-degree lines, hlines) at default width.
  • Three captioned cells (ak2.simulate(..., verbose=True) and the two path_iteration(..., verbose=True) cells) produce a convergence print plus a figure, so their caption sits under mixed output.
File Description
lectures/​ak2.md Adds 8 figure captions with names and lw=2 on all line charts, including ClosedFormTrans/AK2 plot() methods and verbose iteration plots.
lectures/​ak_aiyagari.md Adds 7 figure captions with names and lw=2 on policy, transition, and path_iteration verbose plots; dashed 45-degree/reference lines unchanged.
lectures/​two_computation.md Adds 9 figure captions with names and lw=2 on the four opening line charts that lacked it.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

📖 Netlify Preview Ready!

Preview URL: https://pr-1081--sunny-cactus-210e3e.netlify.app

Commit: 3c6df2f

📚 Changed Lectures


Build Info

This branch has not been deployed

No deployments
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.

2 participants