@@ -276,21 +276,12 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True,
276276 raise ValueError ("GridSpec.subplots() only works for GridSpecs "
277277 "created with a parent figure" )
278278
279- if isinstance (sharex , bool ):
279+ if not isinstance (sharex , str ):
280280 sharex = "all" if sharex else "none"
281- if isinstance (sharey , bool ):
281+ if not isinstance (sharey , str ):
282282 sharey = "all" if sharey else "none"
283- # This check was added because it is very easy to type
284- # `subplots(1, 2, 1)` when `subplot(1, 2, 1)` was intended.
285- # In most cases, no error will ever occur, but mysterious behavior
286- # will result because what was intended to be the subplot index is
287- # instead treated as a bool for sharex. This check should go away
288- # once sharex becomes kwonly.
289- if isinstance (sharex , Integral ):
290- _api .warn_external (
291- "sharex argument to subplots() was an integer. Did you "
292- "intend to use subplot() (without 's')?" )
293- _api .check_in_list (["all" , "row" , "col" , "none" ],
283+
284+ _api .check_in_list (["all" , "row" , "col" , "none" , False , True ],
294285 sharex = sharex , sharey = sharey )
295286 if subplot_kw is None :
296287 subplot_kw = {}
0 commit comments