◐ Shell
clean mode source ↗

Fix title font property precedence by samiat4911 · Pull Request #31877 · matplotlib/matplotlib

PR summary

Explicit title font properties now take precedence over complete font or fontproperties values regardless of keyword argument order.

Previously, these calls produced different font sizes:

ax.set_title("Title", font="DejaVu Sans", fontsize=20)
ax.set_title("Title", fontsize=20, font="DejaVu Sans")

Axes.set_title() now applies complete font properties first, followed by individual properties such as fontsize. Regression tests cover both keyword orders using font-family strings and FontProperties objects.

closes #27608

AI Disclosure

OpenAI Codex was used to analyze the issue, implement the fix and add regression tests. The changes were reviewed and validated with the available local checks.

PR checklist