-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Fix bug in pair plot axis handling #1985
Conversation
This commit fixes some of the issues in the current implementation of plot_pair, making it possible to share axes between subplots in plot_pair and allowing the user to make changes to the tick labels if they so desire.
c280a0c
to
7a2957c
Compare
Codecov Report
@@ Coverage Diff @@
## main #1985 +/- ##
=======================================
Coverage 90.83% 90.84%
=======================================
Files 114 114
Lines 12311 12321 +10
=======================================
+ Hits 11183 11193 +10
Misses 1128 1128
Continue to review full report at Codecov.
|
5684c66
to
e171d72
Compare
This commit rewrites the code to reduce the number of new lines of code needed, and makes the code more similar to the original code. This (hopefully) has the added benefit of not changing test coverage.
Right, I think this PR is ready for review now. The test I put together isn't strictly necessary, I think, but it is useful to make sure that all the axes you'd expect to be shared are indeed shared. |
Another example of the fix introduced by this PR is in the |
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.
Thanks for the improvement
1fe2f80
to
21f229f
Compare
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 left two minor comments, thank you so much for your contribution and patience while we discussed the approach to implement.
Co-authored-by: Oriol Abril-Pla <oriol.abril.pla@gmail.com>
I've made the requested changes, will just make sure that the CI runs alright and then if all is OK I'll leave it with you. Thanks for your help in putting this together and for being so responsive! |
Description
This is an attempt at fixing #1981, in which the subplot axes do not have the same range by default but also lack unique labels. In doing so, I hope to correct some of the counterintuitive behaviour around passing "sharex" or "sharey" as backend parameters. I've written a fix,
and am in the process of adding unit tests for said fixand unit tests for the fix.Update (23/02/22):

I generated an example plot of the marginals, based on the plotpair example gallery code, to illustrate that the marginal axes now fall in the correct place.
Cf. the old behaviour, where the marginal plot axis ticks are not aligned with the plots beneath them, but the labels are also missing.
Checklist
(I removed the "new features" documentation from the list because this isn't a new feature, just a bug fix to correct unexpected behaviour)