-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Explicitely passing an axes to share axis with #1732
Conversation
@@ -910,6 +914,8 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True, | |||
# same as | |||
plt.subplots(2, 2, sharex=True, sharey=True) | |||
""" | |||
if subplot_kw is 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'm not sure this is the most desirable approach. Is is not possible to fix this at the source of the problem (i.e. the change that occurred between 1.1 and 1.2?
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.
What is puzzling you exactly ? As mentioned in #1731 the commit introduce a new feature that was as a matter of fact not handled in 1.1. It avoids the redondant use of sharex as a keyword argument and in subplot_kw.
I'm concerned that sharing axes across figures could cause trouble. What happens if the user closes the figure with the specified Axes? Does that cause the figure with the subplot sharing that Axes to crash when redrawn? |
My understanding of how this worked was that the second axes has a ref to the Experimentally
seems to work fine after closing the first figure. |
I think we need a test for this PR and then it gets my 👍. |
@FabricioS - are you willing to add a test - and then we're good to go. |
@FabricioS: Today is the day we're (hopefully) tagging 1.3.0, so we'll need a test for this PR in order for it to make the cut. |
Sorry for not answering earlier... What kind of test are you expecting ? Extending test_shared in matplotlib / lib / matplotlib / tests / test_subplots.py ? |
@FabricioS You still interested in working on this? I would check that |
@FabricioS - I'm going to go ahead and close this PR. It is not to say I wouldn't be comfortable merging this once it has a test, but the number of lingering mpl PRs makes seeing the wood from the trees a little difficult. Please feel free to re-open once a simple test case exists. All the best, |
See issue #1731