Repository navigation
chang_credible: pass scatter's size, colour and marker by keyword - #76
Conversation
The same change as advanced's copy of this lecture (QuantEcon/lecture-python-advanced.myst#419, merged 2026-11-22): plot_equilibria passed `s`, `c` and `marker` to Axes.scatter positionally. Passing `marker` positionally is deprecated since Matplotlib 3.10 and becomes keyword-only in 3.12, so each of the page's two calls of plot_equilibria printed a MatplotlibDeprecationWarning into its output. The values are unchanged, so the figure is the same. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Validation: a full validationAs for dp's last upgrade (#75): a fresh build with no cache of main and of this pull request, each executing all 51 notebooks in
chang_credible. The two MatplotlibDeprecationWarnings are gone, and both figures are byte-identical. The only other difference is pip's progress spinner while installing Build logs. No Sphinx warning on either side. The rest of the HTML. 13 of 57 pages differ in all. Besides chang_credible, there are 11 pages of output noise, the same as between any two builds: unseeded draws, timings and solver printouts. There is also the status page, with its build times. |
There was a problem hiding this comment.
🔵 Needs a closer look
Because the change affects executable lecture content and rendered figures, human confirmation is still needed to verify visual and notebook-output equivalence across supported Matplotlib and publishing environments.
No open issues 🎉
What changed in this PR
Updates chang_credible.md to pass scatter plot styling arguments by keyword, preventing Matplotlib deprecation warnings while preserving the existing figure output.
Changes:
- Passes scatter size, colour, and marker via keyword arguments.
- Preserves the existing values and plot ordering.
- Keeps both existing
plot_equilibriacalls unchanged.
| File | Description |
|---|---|
| lectures/chang_credible.md | Updates the plot_equilibria scatter call to use keyword arguments for size, colour, and marker. |
Review effort: Lite (adaptive)
Validation correction: pages whose only difference is a figureThe evidence comment above says 13 of 57 pages differ. The comparison behind it compared a figure only when the page wraps it in a link, and this series doesn't, so a page whose only difference is a figure wasn't counted. With every figure now compared by content, 27 of 57 pages differ. The 14 added pages differ only in figures:
This pull request's own pages. chang_credible, the page it changes, has the same two figures on both sides, byte for byte, as the evidence comment says. None of the added pages is one this pull request changes, and each also differs when the same main build is compared with the build of #81, which changes only the conda channel's name and installs the same packages. The conclusion doesn't change: no other page's prose differs. |
What
The same one-line change as advanced's copy of this lecture, QuantEcon/lecture-python-advanced.myst#419 (merged 2026-11-22).
plot_equilibriain chang_credible passed the size, colour and marker toAxes.scatterpositionally:ax.scatter(R[0], R[1], 150, 'black', 'o', zorder=1)ax.scatter(R[0], R[1], s=150, c='black', marker='o', zorder=1)Passing
markerpositionally has been deprecated since Matplotlib 3.10, and it becomes keyword-only in 3.12. So each of the page's two calls ofplot_equilibriaprints a MatplotlibDeprecationWarning into its output. The values are unchanged, so the figures should be the same. chang_ramsey's similar call already passesmarkerby keyword, and is left as it is.This is part of reporting lecture fixes upstream to each lecture's source of truth (QuantEcon/project-monorepo#77). dp publishes this copy of the lecture.
Validation
Done on 2026-11-22, a full validation: fresh builds with no cache of this pull request and of main, every notebook executed, both green. The evidence is in the comment below.
This changes lecture content, so it needs a person's review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL