Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
[ENH]: add Figure.align_titles() functionality#22793
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
aswarner commentedApr 6, 2022
We are working on documentation/testing and need to squash the commits. |
There was a problem hiding this 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 while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| # grouper for groups of xlabels to align | ||
| self._align_label_groups['x'].join(ax,axc) | ||
| defalign_titles(self,axs=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wonder if we want to addalign_titles toalign_labels? Though this would be a breaking change ofalign_labels.
jklymak left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Overall this looks good! Not set on rolling into_align_label_groups, but might be more compact.
aswarner commentedApr 10, 2022
We aligned the titles by changing the image bounding boxes, which works with |
jklymak commentedApr 11, 2022
I am not on my computer for a few days to look properly what you mean. However the alignment should work the same as for x and y labels. All of them may need a draw before they are correct to get the text sizes correct. |
update testfirstcopy a bbox function to axesBase from figureadd broken code? commented outalign titles worksfinish code and add testsadd demoremove readme2
test cases
| @@ -0,0 +1,26 @@ | |||
| """ | |||
| =============== | |||
| Aligning Labels | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| AligningLabels | |
| AligningTitles |
?
| return | ||
| titles=(self.title,self._left_title,self._right_title) | ||
| titles=[self.title,self._left_title,self._right_title] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is this required? It doesn't look like you are actually modifyingtitles.
| return | ||
| titles=(self.title,self._left_title,self._right_title) | ||
| titles=[self.title,self._left_title,self._right_title] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| titles=[self.title,self._left_title,self._right_title] | |
| titles=(self.title,self._left_title,self._right_title) |
melissawm commentedDec 20, 2022
Hi@aswarner - can we help you move this forward? Thanks! |
jklymak commentedFeb 9, 2023
ping@aswarner just had another request for this feature today. If you are not moving forward with the PR, should we open up to other folks? Thanks! |
rcomer commentedMar 31, 2024
Closing in favour of#27952. |
PR Summary
Resolves#22376 . Add
Figure.align_titles()function, which automatically aligns titles of subplots on a single figure, in the style ofalign_labels().NOTE: This PR contains tested code but we still need to complete documentation and pytest.
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).