Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6df722f

Browse files
committed
Merge pull request #5735 from jenshnielsen/fixfilterwarnings
FIX: Correct regex in filterwarnings
2 parents 898891f + 6979fe5 commit 6df722f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/matplotlib/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,8 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
10971097
# instead treated as a bool for sharex.
10981098
if isinstance(sharex, int):
10991099
warnings.warn(
1100-
"sharex argument to add_subplots() was an integer. "
1101-
"Did you intend to use add_subplot() (without 's')?")
1100+
"sharex argument to subplots() was an integer. "
1101+
"Did you intend to use subplot() (without 's')?")
11021102

11031103
raise ValueError("sharex [%s] must be one of %s" %
11041104
(sharex, share_values))

lib/matplotlib/tests/test_subplots.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def test_exceptions():
113113
message='.*sharex\ argument\ to\ subplots',
114114
category=UserWarning)
115115
assert_raises(ValueError, plt.subplots, 2, 2, -1)
116-
# uncomment this for 1.5
117-
# assert_raises(ValueError, plt.subplots, 2, 2, 0)
116+
assert_raises(ValueError, plt.subplots, 2, 2, 0)
118117
assert_raises(ValueError, plt.subplots, 2, 2, 5)
119118

120119

0 commit comments

Comments
 (0)