-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
make plt.subplot() act as plt.subplot(111) #1475
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
make plt.subplot() act as plt.subplot(111)
Since plt.subplots() make an assumption of what you want when you call it without arguments, and as does plt.axes(), there's no reason why plt.subplot() shouldn't make the same assumption.
- Loading branch information
commit bf83c161a6907009489ba8970ca30a81175c9905
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -727,6 +727,9 @@ def subplot(*args, **kwargs): | |
|
||
``subplot(111)`` is the default axis. | ||
|
||
``subplot()`` by itself is the same as ``subplot(111)`` | ||
|
||
|
||
New subplots that overlap old will delete the old axes. If you do | ||
not want this behavior, use | ||
:meth:`~matplotlib.figure.Figure.add_subplot` or the | ||
|
@@ -768,6 +771,10 @@ def subplot(*args, **kwargs): | |
.. plot:: mpl_examples/pylab_examples/subplot_demo.py | ||
|
||
""" | ||
# if subplot called without arguments, create subplot(1,1,1) | ||
if len(args)==0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's merged so it doesn't matter, but in future we are trying to standardise the code base towards PEP8 which recommends spaces between operators (and after commas). I'm not worried about getting this sorted (it will get picked up eventually by an automatable tool). Cheers, |
||
args=(1,1,1) | ||
|
||
# This check was added because it is very easy to type | ||
# subplot(1, 2, False) when subplots(1, 2, False) was intended | ||
# (sharex=False, that is). In most cases, no error will | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we are using
CHANGELOG
any more. I think this should go inwhats_new.rst
instead.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 have no problem with updating CHANGELOG, although it is getting sparse to do so now. But this definitely should go into whats_new.rst.
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.
Ok, but on the first line (after the title) of
whats_new.rst
says:EDIT: got my wires crossed and thought this comment was about a different PR. Now updated this PR as well
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.
My guess is that it will go into 1.3 (or whatever the new version is called), since 1.2.1 should be for critical bugfixes.
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.
My feeling is that "What's new" is for high-level user-visible changes (sort of like an advertisment for the new release), and CHANGELOG (which I believe we are still using) is for smaller details that users need to know about. We also have api_changes for things where we know users need to change their code. (I don't think this falls into that category because
subplots()
would have raised an exception before and now does something new).