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

Skip to content

Commit 6979fe5

Browse files
committed
Change error message to reflect the name of the method
1 parent d9c9c55 commit 6979fe5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def test_exceptions():
110110
# the pount of this test is to ensure that this raises.
111111
with warnings.catch_warnings():
112112
warnings.filterwarnings('ignore',
113-
message='.*sharex\ argument\ to\ add_subplots',
113+
message='.*sharex\ argument\ to\ subplots',
114114
category=UserWarning)
115115
assert_raises(ValueError, plt.subplots, 2, 2, -1)
116116
assert_raises(ValueError, plt.subplots, 2, 2, 0)

0 commit comments

Comments
 (0)