Skip to content

chang_credible: pass scatter's size, colour and marker by keyword - #419

Merged
mmcky merged 1 commit into
mainfrom
chang-credible-scatter-keywords
Nov 22, 2026
Merged

mmcky merged 1 commit into
mainfrom
chang-credible-scatter-keywords

Conversation

@mmcky

@mmcky mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

plot_equilibria in chang_credible passed the size, colour and marker to Axes.scatter positionally:

Before After
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 marker positionally has been deprecated since Matplotlib 3.10, and it becomes keyword-only in 3.12. So each of the page's two calls of plot_equilibria prints this into its output:

MatplotlibDeprecationWarning: Passing the marker parameter of scatter() positionally is deprecated since Matplotlib 3.10; the parameter will become keyword-only in 3.12.

The values are unchanged, so the figure should be the same. The two warnings were found by the environment scan of 2026-11-19, for QuantEcon/project-monorepo#77, and they are also in the build of this site from the lecture monorepo, QuantEcon/lectures#86.

lecture-dp publishes a copy of this lecture with the same line; it follows once this is merged.

Validation

Done on 2026-11-22; the evidence is in the comment below. The build re-executed chang_credible: the two warnings are gone, the three figures are byte-identical to main's, and nothing else on the page changed.

This changes lecture content, so it needs a person's review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@netlify

netlify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for lustrous-melomakarona-3ee73e ready!

Name Link
🔨 Latest commit caa7900
🔍 Latest deploy log https://app.netlify.com/projects/lustrous-melomakarona-3ee73e/deploys/6b02bae6e9249906c425db3c
😎 Deploy Preview https://deploy-preview-419--lustrous-melomakarona-3ee73e.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

Copy link
Copy Markdown
Contributor

@github-actions
github-actions Bot temporarily deployed to pull request November 22, 2026 10:04 Inactive
@mmcky

mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation

This pull request's build, 45009483978 at caa7900, executed chang_credible alone (275 seconds) and took every other page from main's build cache. It is compared with main's two fresh builds of today at 63ef0be, this branch's base: 44998881695 and 45001954151, the build whose cache this one restored.

main, 44998881695 main, 45001954151 this pull request
MatplotlibDeprecationWarning in chang_credible's outputs 2 2 0
chang_credible's figures 2 2, byte-identical 2, byte-identical

Against 45001954151, two pages differ, out of 85:

  • chang_credible: the changed line itself (s=, c=, marker=), and the two warnings, which are gone. Every other output is the same.
  • status: the build's time, and chang_credible's run time on the execution table.

The build log has no Sphinx warning.

(Corrected 2026-11-22: the page has two figures, one per plot_equilibria call; the conclusion is unchanged.)

@mmcky
mmcky marked this pull request as ready for review November 22, 2026 10:08
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 10:08

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

Human review is warranted because the change affects executable lecture content and rendered educational figures, requiring confirmation that the documented output and Matplotlib visuals remain equivalent across supported build environments.

No open issues 🎉

What changed in this PR

Updates the chang_credible lecture to use keyword arguments for Matplotlib's Axes.scatter, eliminating the positional marker deprecation while preserving the existing plot output.

Changes:

  • Passes scatter size, colour, and marker via s, c, and marker keywords.
  • Keeps the existing plotting values and behavior unchanged.
File Description
lectures/​chang_credible.md Updates the plot_equilibria scatter call to use keyword arguments for marker size, colour, and style.

Review effort: Lite (adaptive)

@mmcky
mmcky merged commit 354faf5 into main Nov 22, 2026
10 checks passed
@mmcky
mmcky deleted the chang-credible-scatter-keywords branch November 22, 2026 10:15

This branch was previously deployed

1 inactive deployment
pull request — caa79003 Deployed Nov 22, 2026 by github-actions[bot]
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