Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added default kwargs values to figure.suptitle() in rcParams and inheritance for function #27436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ngmatt882
Copy link

@ngmatt882 ngmatt882 commented Dec 4, 2023

PR summary

This PR addresses issue #24090 which requests to added default kwargs parameters to use for function figure.suptitle() in rcParams. Basic default parameters have been added and adapted to use in inheritance. PR needs to be reviewed and can closes #24090.

PR checklist

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

You can also join us on gitter 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.

@oscargus
Copy link
Member

oscargus commented Dec 4, 2023

Thanks for this!

Some quick notes:

It seems like to naming is inconsistent in the files. For example: figure.title_locy, figure.titleloc_y, and figure.title_y are all used for what I believe is the same parameter. I think there needs to be some discussion about the "best" name. (Personally, I think figure.title.y, but since there is, e.g., figure.titlesize already, it doesn't really make sense to change format.)

This will also need a "What's new"-note.

@ngmatt882
Copy link
Author

Thanks for catching that. I settled for title_x and title_y as a good mix of both naming formats.

@ksunden
Copy link
Member

ksunden commented Dec 6, 2023

there is still a mix of title_ha and titleha, causing CI to fail

@@ -331,8 +331,9 @@ def _suplabels(self, t, info, **kwargs):
@_docstring.copy(_suplabels)
def suptitle(self, t, **kwargs):
# docstring from _suplabels...
info = {'name': '_suptitle', 'x0': 0.5, 'y0': 0.98,
'ha': 'center', 'va': 'top', 'rotation': 0,
info = {'name': '_suptitle', 'x0': 'figure.title_x',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand how x0 and y0 get turn from the rcParam names into actual values?

My guess is that this is related to the failures in the doc build

@tacaswell tacaswell added this to the v3.9.0 milestone Dec 7, 2023
@QuLogic QuLogic modified the milestones: v3.9.0, v3.10.0 Mar 15, 2024
@QuLogic QuLogic modified the milestones: v3.10.0, future releases Sep 18, 2024
@tacaswell tacaswell marked this pull request as draft September 18, 2024 21:16
@tacaswell
Copy link
Member

This needs a reabase and we think there is still a missing part of the implementation where we actually use the new rcparams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

[ENH]: Add default kwargs values if figure.suptitle(t, **kwargs) to rcParams and inherit from there.
5 participants