FIX: set_font() should not do full font reset for str arguments by timhoffm · Pull Request #31956 · matplotlib/matplotlib · GitHub
Skip to content

FIX: set_font() should not do full font reset for str arguments#31956

Open
timhoffm wants to merge 2 commits into
matplotlib:mainfrom
timhoffm:fix-font-priority
Open

FIX: set_font() should not do full font reset for str arguments#31956
timhoffm wants to merge 2 commits into
matplotlib:mainfrom
timhoffm:fix-font-priority

Conversation

@timhoffm

Copy link
Copy Markdown
Member

Closes #27608

PR summary

A str is interpreted as a fontconfig pattern and should only update the specified parts.

This is solution 2 from #27608 (comment)

This is a breaking change, but there is no smooth transition path. I'd label this a bug fix and by that justify the immediate change.

AI Disclosure

Solution strategy previously discussed in the above mentioned issue. Implementation and tests supported with AI, but human-edited for some fine-tuning and human-verified.

Comment thread lib/matplotlib/text.py Outdated
Comment thread doc/api/next_api_changes/behavior/text_set_font_partial_update.rst Outdated
Comment thread doc/api/next_api_changes/behavior/text_set_font_partial_update.rst Outdated
@rcomer

rcomer commented Jun 27, 2026

Copy link
Copy Markdown
Member

Closes matplotlib#27608

A str is interpreted as a fontconfig pattern and should only update
the specified parts.

This is solution 2 from matplotlib#27608 (comment)

This is a breaking change, but there is no smooth transition path. I'd label this a bug fix and by that justify the immediate change.

Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
@timhoffm timhoffm force-pushed the fix-font-priority branch from e30bc75 to b494ace Compare July 2, 2026 21:04
Comment thread lib/matplotlib/text.py Outdated
@story645 story645 added this to the v3.11.1 milestone Jul 3, 2026
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
@timhoffm

timhoffm commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@timhoffm timhoffm modified the milestones: v3.11.1, v3.12.0 Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Font kwargs for pyplot.title only work in certain order

3 participants