You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at this for a couple weeks -- it doesn't appear to be as easy as expected. We can replicate the grouping of axes with the the same rowspans, as done in align_xlabels(), however, updating the title location is done in the _AxesBase class, while the label updates are done in the Figure class. Importantly, the Figure class has access to subplots, but the axesBase class does not have a way to access the subplots or a grouper we make in the figure class, where align_titles() would exist. @anntzer I'm new to Matplotlib, was wondering if there is some workaround I'm missing to share the relevant data between the classes.
Basically, we'd need to share either a grouper object or subplot location information from the Figure class (where the align_titles function would be written) to the axesBase class (where the title update occurs). Do you have any thoughts or are we missing anthing?
the title moving logic was copied from the x/ylabel moving logic, so aligning the titles should be possible after the automated moving that happens in Axes, just as its possible to align the x/y labels.
I took a quick look at this again. The logic in axis.py is exactly the same logic you would need to use in _base.py in _update_title_position. You can just make another _align_label_groups['titles']. I think there are some details to work out, but the information flow is exactly the same as for the way it is set up now.
Thank you for the response! That's what I tried, but I don't see how the AxesBase class in_base.pyhas access to the _align_label_groups['titles'] which is part of the FigureBase class.
The issue is open, so not solved yet. But as linked above, it has an associated open pull request, i.e. a solution proposal. Therefore it does not make sense to work on this issue. Please look for another topic if you want to contribute.
As a side question, we often see people who ask in the way you did above coming from a CS course? Is that true for you as well? If so, which course and did they give you instructions on how to find suitable issues, in particular identifying whether an issue has already an associated open pull request and to judge whether that pull request is still active?
Activity
QuLogic commentedon Feb 3, 2022
This is probably a good first issue; you have to copy what
align_xlabelsdoes, but using the title texts.pradhanvickey commentedon Feb 9, 2022
@QuLogic / @anntzer - I would like to work on this, can I give it a try? :)
anntzer commentedon Feb 9, 2022
Go for it.
pradhanvickey commentedon Feb 9, 2022
Thanks @anntzer . Will start working on it
weiji-li commentedon Mar 21, 2022
@pradhanvickey are you still working on this issue?
jklymak commentedon Mar 22, 2022
We tend not to reserve issues. If there is no PR feel free to submit one.
neil-gurnani commentedon Mar 23, 2022
@QuLogic / @anntzer. Both @lijake8 and myself would like to work on this. Is this okay?
Take
kkoutris commentedon Mar 28, 2022
Is this issue still open?
If yes can you assign me @anntzer ?
anntzer commentedon Mar 28, 2022
See https://matplotlib.org/devdocs/devel/contributing.html#issues-for-new-contributors.
kkoutris commentedon Mar 28, 2022
I don’t see any PR on the issue but probably @neil-gurnani is still working on it. I’ll wait a couple of days or look for a different issue.
aswarner commentedon Mar 30, 2022
I've been looking at this for a couple weeks -- it doesn't appear to be as easy as expected. We can replicate the grouping of axes with the the same rowspans, as done in align_xlabels(), however, updating the title location is done in the _AxesBase class, while the label updates are done in the Figure class. Importantly, the Figure class has access to subplots, but the axesBase class does not have a way to access the subplots or a grouper we make in the figure class, where align_titles() would exist. @anntzer I'm new to Matplotlib, was wondering if there is some workaround I'm missing to share the relevant data between the classes.
Basically, we'd need to share either a grouper object or subplot location information from the Figure class (where the align_titles function would be written) to the axesBase class (where the title update occurs). Do you have any thoughts or are we missing anthing?
jklymak commentedon Mar 30, 2022
the title moving logic was copied from the x/ylabel moving logic, so aligning the titles should be possible after the automated moving that happens in
Axes, just as its possible to align the x/y labels.jklymak commentedon Mar 30, 2022
I took a quick look at this again. The logic in
axis.pyis exactly the same logic you would need to use in_base.pyin_update_title_position. You can just make another_align_label_groups['titles']. I think there are some details to work out, but the information flow is exactly the same as for the way it is set up now.aswarner commentedon Mar 30, 2022
Thank you for the response! That's what I tried, but I don't see how the AxesBase class in
_base.pyhas access to the_align_label_groups['titles']which is part of the FigureBase class.jklymak commentedon Mar 30, 2022
Each axes has a self.figure.
aswarner commentedon Apr 3, 2022
@jklymak That helped! We figured it out and are working on testing and documentation
christuangsit commentedon Apr 2, 2024
Hello, is this issue solved? If not, my friend and I would like to work on it.
timhoffm commentedon Apr 2, 2024
The issue is open, so not solved yet. But as linked above, it has an associated open pull request, i.e. a solution proposal. Therefore it does not make sense to work on this issue. Please look for another topic if you want to contribute.
As a side question, we often see people who ask in the way you did above coming from a CS course? Is that true for you as well? If so, which course and did they give you instructions on how to find suitable issues, in particular identifying whether an issue has already an associated open pull request and to judge whether that pull request is still active?