@@ -1524,23 +1524,17 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
15241524 sharex = "all" if sharex else "none"
15251525 if isinstance (sharey , bool ):
15261526 sharey = "all" if sharey else "none"
1527- share_values = ["all" , "row" , "col" , "none" ]
1528- if sharex not in share_values :
1529- # This check was added because it is very easy to type
1530- # `subplots(1, 2, 1)` when `subplot(1, 2, 1)` was intended.
1531- # In most cases, no error will ever occur, but mysterious behavior
1532- # will result because what was intended to be the subplot index is
1533- # instead treated as a bool for sharex.
1534- if isinstance (sharex , Integral ):
1535- cbook ._warn_external ("sharex argument to subplots() was an "
1536- "integer. Did you intend to use "
1537- "subplot() (without 's')?" )
1538-
1539- raise ValueError ("sharex [%s] must be one of %s" %
1540- (sharex , share_values ))
1541- if sharey not in share_values :
1542- raise ValueError ("sharey [%s] must be one of %s" %
1543- (sharey , share_values ))
1527+ # This check was added because it is very easy to type
1528+ # `subplots(1, 2, 1)` when `subplot(1, 2, 1)` was intended.
1529+ # In most cases, no error will ever occur, but mysterious behavior
1530+ # will result because what was intended to be the subplot index is
1531+ # instead treated as a bool for sharex.
1532+ if isinstance (sharex , Integral ):
1533+ cbook ._warn_external (
1534+ "sharex argument to subplots() was an integer. Did you "
1535+ "intend to use subplot() (without 's')?" )
1536+ cbook ._check_in_list (["all" , "row" , "col" , "none" ],
1537+ sharex = sharex , sharey = sharey )
15441538 if subplot_kw is None :
15451539 subplot_kw = {}
15461540 if gridspec_kw is None :
0 commit comments