-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: add supxlabel and supylabel #17524
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
Conversation
d53bc29
to
d1a0cc4
Compare
Have you considered that people might want suplabels on parts of a grid? e.g. columns 1 and 2 share an xlabel while column 0 has it's own label. I'm not claiming that you should implement it now or even that it's necessary, but the desire may come up. If we consider this a reasonable extension, we should at least think about if an extension of the proposed API in that direction is possible and staight forward. |
Right now the API is the same as There are two somewhat orthogonal issues here.
|
i.e. this figure just has suptitles for each subpanel, but was made w two subpanels, and could just as easily have supx and supylabels (from #17437) |
@sks-2020 What do you anticipate wanting to do with gridspec that the sub-panel functionality won't give you? |
@jklymak I think the subpanel function will solve what I am hoping to do. My issue is the same as outlined here: I found a possible way of solving this, but doesn't use the neat layout option of using gridspec: In summary, I have a gridspec subplots layout within another gridspec. I do the plotting part in the inner grid and need the labeling flexibility in the outer grid. At the moment, using the current release of matplotlib, I can only achieve this using text annotations. Inbuilt functions (like supxlabel, supylabel, supxticklabels, supyticklabels, suptitle), for the outer grid, will be very useful. |
@mwaskom This is the suplabel PR. This doesn't really require the other PR, but would be nice to do it after.... |
I'm afraid I don't know where to find it in the diff, but is the default font size here bigger than regular axes labels? I'm not sure I've ever needed to add a "suplabel" pertaining to multiple axes that have existing, distinct labels. My use-case is almost always a situation where I have multiple subplots with shared axes and I want to add a single label to identify them. In that case, I'd want to the label to have the same size as a normal axis label. Also, will these suplabels be tighter against the axes when there are no first-order labels? I won't assert or claim to know which is a more common usecase, but I do think it's an application this PR should consider... |
I think they may be larger by default (just like suptitle) but the user can change this. If there are no individual labels and you use constrained_layout the suplabels will be tight against the axes. Can likely be made to work with tight_layout as well. With no layout manager the whole thing is a bit of a mess anyhow. As noted above, the suplables will be centered on the figure, not the spines or some other measure of what the label is supposed to span. That may or may not be acceptable depending on axes decorations, but it's a lot simpler. |
d1a0cc4
to
0f76488
Compare
e2d9131
to
acc550a
Compare
acc550a
to
96ff8f0
Compare
This is ready for review, and closes at least one feature request, and something seaborn would like. |
dfe0086
to
2c51392
Compare
e5e4813
to
dfd9ed0
Compare
b5a9247
to
04b736f
Compare
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
883e722
to
82601a7
Compare
Were we relying on Travis to run any unique test configurations? I'm wondering why test lines execute has dropped so much... |
Is it not posting? It seems to have run... Not everything is installed in Azure Pipelines, so I don't think it covers the same things. |
Oh, I did not notice the date. I guess we'll put this back on the meeting agenda. |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
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.
This is very nice looking!
I also really like the test images, they make it very clear what is going on.
Anyone can merge on CI green. |
Code coverage is normal again, since this ran with GitHub Actions after @tacaswell's commit. |
Thanks for everyone's reviews, and for @QuLogic for fixing codecov! |
PR Summary
UPDATE: 10 Oct 2020, this still works as below.
There are a couple of fixes to padding in
suptitle
placement inconstrained_layout
.This PR adds
supxlabel
andsupylabel
. Works with tight_layout and the new constrained_layout. Not so well with no layout manager ;-)Closes #11147
PR Checklist