diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 439785d9fd30..9e8c2402523a 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1097,8 +1097,8 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False, # instead treated as a bool for sharex. if isinstance(sharex, int): warnings.warn( - "sharex argument to add_subplots() was an integer. " - "Did you intend to use add_subplot() (without 's')?") + "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)) diff --git a/lib/matplotlib/tests/test_subplots.py b/lib/matplotlib/tests/test_subplots.py index 5af1716821bc..d588f7b4b13b 100644 --- a/lib/matplotlib/tests/test_subplots.py +++ b/lib/matplotlib/tests/test_subplots.py @@ -113,8 +113,7 @@ def test_exceptions(): message='.*sharex\ argument\ to\ subplots', category=UserWarning) assert_raises(ValueError, plt.subplots, 2, 2, -1) - # uncomment this for 1.5 - # assert_raises(ValueError, plt.subplots, 2, 2, 0) + assert_raises(ValueError, plt.subplots, 2, 2, 0) assert_raises(ValueError, plt.subplots, 2, 2, 5)