8000 Added warnings for easily confusible subplot/subplots invokations by WeatherGod · Pull Request #898 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Added warnings for easily confusible subplot/subplots invokations #898

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

Merged
merged 2 commits into from
Jul 18, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Correcting for a bad rebase.
  • Loading branch information
WeatherGod committed Jul 7, 2012
commit 92d2ae3fc3f043ab5fcd6ce2da76517671be88a2
7 changes: 3 additions & 4 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,16 +911,15 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
# ever occur, but mysterious behavior will result because what was
# intended to be the subplot index is instead treated as a bool for
# sharex.
if isinstance(sharex, int) :
warnings.warn("sharex argument to subplots() was not boolean."
" Did you intend to use subplot()?")
if isinstance(sharex, int):
warnings.warn("sharex argument to subplots() was an integer."
" Did you intend to use subplot() (without 's')?")

raise ValueError("sharex [%s] must be one of %s" % \
(sharex, share_values))
if sharey not in share_values:
raise ValueError("sharey [%s] must be one of %s" % \
(sharey, share_values))

if subplot_kw is None:
subplot_kw = {}

Expand Down
0