feat: add rcParams for suptitle alignment#31767
Conversation
Add 'figure.titlehorizontalalign' and 'figure.titleverticalalign' rcParams so that users can control the default alignment of figure titles via rc settings. Before: Only fontsize and fontweight were configurable via rcParams; ha/va were hardcoded to 'center'/'top'. After: rcParams['figure.titlehorizontalalign'] defaults to 'center' rcParams['figure.titleverticalalign'] defaults to 'top' Explicit suptitle() kwargs still override rcParam defaults. - Added validate_suptitle_ha validator in rcsetup.py - Updated figure._suplabels to resolve ha/va from rcParams when set - Updated matplotlibrc with new default entries - Added 2 tests: rcParams alignment and kwarg override - Updated docstring to reference new rcParams
|
Thanks for the interest in contributing. However, the PR does not meet our quality standards: It doesn't use the PR template, it doesn't reflect the state of discussion, e.g. naming (#24090 (comment)), I suspect violoation of our AI policy. On a general note: You have opened 8 PRs on 8 different projects within a day. This is not a valuable way of contributing to open source. Either AI has done most or all of the work, which - if desired at all - is better be controlled by project mantainers and not random external contributors, or you as a human try to seriously engage with seveal projects at once, which is a waste of resources. |
|
Thanks for the feedback, @timhoffm. I've opened a replacement PR (#31768) with:
Appreciate you taking the time to review. |
|
Thanks for the feedback, @timhoffm. I have opened a replacement PR (#31768) with:
Appreciate you taking the time to review. |
Add
figure.titlehorizontalalignandfigure.titleverticalalignrcParamsFixes #24090
Problem
suptitle()defaults for horizontal and vertical alignment were hardcoded (center/top). Onlyfontsizeandfontweightwere configurable via rcParams. Users who wanted to control suptitle alignment had to callsuptitle(ha=..., va=...)every time — no way to set a project-wide default via rc settings.Solution
Added two new rcParams:
figure.titlehorizontalalign(default:"center") — validates against{center, left, right, center_left, center_right}figure.titleverticalalign(default:"top") — validates against standard vertical alignmentsChanges
validate_suptitle_havalidator + two new rcParam entries with defaults_suplabels()to resolve ha/va from rcParams when the key is setRcKeyTypeenumBackwards Compatibility
Fully backwards compatible. Default values match the old hardcoded defaults (
center/top). Existing code that passes explicitha/vakwargs is unaffected.