Skip to content

Carry the canvas caption on the drawn figures - #97

Merged
max-models merged 2 commits into
develfrom
cloud/youthful-thompson-hdhhz4
Nov 14, 2026
Merged

max-models merged 2 commits into
develfrom
cloud/youthful-thompson-hdhhz4

Conversation

@max-models

@max-models max-models commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Canvas(caption=...) was stored but never used. Now:

  • plot_matplotlib sets fig.caption on the Matplotlib figure;
  • plot_plotly puts it in layout.meta["caption"];
  • web_figure takes meta["caption"] as the title hint (the caption the docs page shows) when no title is given, so canvas.to_json() and savefig("x.plotly.json") carry it.

Docs and gallery tools read fig.caption to write the caption under the figure.

Also a fix for Python 3.14, which the CI runner now uses (two import tests failed on devel too):

  • Matplotlib's categorical units keep an itertools.count, which Python 3.14 no longer copies: copying a categorical axis failed. itertools.count is made copyable again from its repr.
  • copy.deepcopy on 3.14 returns functions and builtin methods before reading the memo, so a snapshot of an imported artist kept the source's _remove_method and with it the source figure. The copies' removal and stale callbacks are now dropped explicitly.

Tests pass on Python 3.13 and 3.14 (353 passed).

@max-models
max-models force-pushed the cloud/youthful-thompson-hdhhz4 branch from 19ee06a to 888f08a Compare November 14, 2026 10:07
@max-models
max-models merged commit e9149b2 into devel Nov 14, 2026
32 checks passed
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