You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ak2, ak_aiyagari, two_computation] Add figure captions and lw=2 per the style guide #1080
Follow-up from the style pass on #1078 (now live in publish-2026oct09). Two figure conventions from the manual's figures page are only partly applied in these three lectures. Neither affects correctness, so this is a cleanup task.
1. Every code-generated figure should carry a caption
The manual asks for mystnb: figure: caption metadata on every code-generated figure, rendered as "Fig N. caption". #1078 added captions to the single-panel figures whose embedded titles were removed, but the multi-panel figures are still uncaptioned.
Lecture
Figure cells
Uncaptioned
Where
ak2
4
3
the three .plot() calls on ClosedFormTrans and AK2 (Experiments 1, 3 and 4)
ak_aiyagari
8
5
policy functions, the two transition-path grids, the mean/variance surfaces, and the cross-section figure
two_computation
10
4
the Experiment 1 asset/compensation, transition-path, cohort-consumption and fixed-vs-endogenous grids
These counts cover the main text only and skip figures drawn by helper functions such as plot_surface_grid in two_computation, so the real number is a little higher.
Constraints to respect:
Captions go on the {code-cell} directive, not inside the plotting code, and the figure needs a name for numref.
Captions are lowercase after the first letter and about five or six words.
Figures inside exercise and solution directives must stay uncaptioned, because the caption wraps the image in a LaTeX float and breaks the PDF build. The new exercises in all three lectures print tables rather than figures, so this mostly does not bite, but keep it in mind.
Multi-panel figures may keep their per-axis set_title calls; the caption describes the figure as a whole.
2. Use lw=2 for line charts
Rule 8 on the same page asks for lw=2 on all matplotlib line charts. two_computation already does this for its experiment figures. ak2 and ak_aiyagari have no line widths set anywhere, including inside the plot() methods of ClosedFormTrans and AK2, and path_iteration's verbose plots.
Lecture
Line-chart cells without lw=2
ak2
4 of 4
ak_aiyagari
8 of 8
two_computation
4 of 10, all in the opening sections
Suggested approach
One PR per lecture keeps the diffs reviewable, since the captions touch many cells. The plot() methods in ak2 produce one figure each, so a caption on the cell that calls them is enough.
Activity