Add rcParams for figure.suptitle() kwargs (x, y, horizontalalignment, verticalalignment)#31889
Conversation
… alignment rcParams
…label with literal defaults
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
PR summary
Add rcParams for
figure.suptitle()default kwargs (x,y,horizontalalignment,verticalalignment), as requested in #24090.The new rcParams are:
figure.title_x(float, default: 0.5)figure.title_y(float, default: 0.98)figure.title_horizontalalignment(str in {'center', 'left', 'right'}, default: 'center')figure.title_verticalalignment(str in {'top', 'center', 'bottom', 'baseline'}, default: 'top')These follow the existing pattern used by
axes.titlelocation(mpl._val_or_rc()). The_suplabelsmethod now checks whetherinfo['x0']/info['y0']are strings (rcParams keys) or literals, sosupxlabel/supylabelremain unaffected.This only adds rcParams for
suptitle;supxlabelandsupylabelare left unchanged because they sharefigure.label_*keys but have different default positions (supxlabel y=0.01 vs supylabel y=0.5), which would create naming conflicts.AI Disclosure
This PR was written with the assistance of AI (CodeBuddy agent). The AI was used to implement the code changes, write tests, and draft this PR description under the direction of the human author. All changes were reviewed and tested by the human author.
PR checklist
Release note
Add the following rcParams:
figure.title_x,figure.title_y,figure.title_horizontalalignment,figure.title_verticalalignment. These control the default position and alignment offigure.suptitle().