Repository navigation
Conversation
to_templated skipped every property named "title" by default. Titles have been compound objects since plotly.py 4, so this dropped the whole title from the template, including title.font, title.x and the axis title fonts. Skip only "text" by default, which keeps the title text out of the template as the docstring says, and moves the other title properties to the template. Fixes plotly#3580 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atishay-kasliwal
left a comment
There was a problem hiding this comment.
Ran to_templated on a figure with styled titles everywhere: layout title (with x and a subtitle), x-axis title, legend title, a colorbar title and a pie trace title. Each now keeps only its text on the figure (and the subtitle's text); font, x, standoff, side and position move to the template. Main kept all of it on the figure, and the template only had defaults. Passing skip=("title", "text") gives exactly the old output. The new test fails on main, and all 34 in test_template.py pass here.
Unrelated to this change, and the same on main: per-annotation positions also go into annotationdefaults. Two annotations at (1, 1) and (2, 3) come out as text only, with a default of x=2, y=3, so both render at (2, 3).
Link to issue
Closes #3580
Description of change
pio.to_templatedskipped every property namedtitleby default. Titles have been objects since plotly.py 4, so the whole title was dropped, includingtitle.fontand axis title fonts. The defaultskipis now("text",): the title text stays on the figure, and the other title properties go to the template.Demo
Testing strategy
New test
test_move_layout_title_style_propertiesintests/test_core/test_graph_objs/test_template.pyfails before the change and passes after.tests/test_core,tests/test_plotly_utilsand theto_templateddoctest pass;ruff checkandruff format --checkare clean on the changed files.Additional information (optional)
A caller who passes
skip=("title", "text")explicitly keeps the old behaviour.Guidelines
AI disclosure: written with Claude Code (Claude Opus 5.5), which found the cause, wrote the change and the test, and ran the checks.
🤖 Generated with Claude Code