@@ -347,27 +347,33 @@ def __init__(self, fig, *args, horizontal=None, vertical=None,
347347 (2, 3, 4)).
348348 """
349349 self .figure = fig
350- self ._subplotspec = SubplotSpec ._from_subplot_args (fig , args )
351- self .update_params () # sets self.figbox
352- super ().__init__ (fig , pos = self .figbox .bounds ,
350+ super ().__init__ (fig , [0 , 0 , 1 , 1 ],
353351 horizontal = horizontal or [], vertical = vertical or [],
354352 aspect = aspect , anchor = anchor )
353+ self .set_subplotspec (SubplotSpec ._from_subplot_args (fig , args ))
355354
356355 def get_position (self ):
357356 """Return the bounds of the subplot box."""
358- self .update_params () # update self.figbox
359- return self .figbox .bounds
357+ return self .get_subplotspec ().get_position (self .figure ).bounds
360358
359+ @cbook .deprecated ("3.4" )
360+ @property
361+ def figbox (self ):
362+ return self .get_subplotspec ().get_position (self .figure )
363+
364+ @cbook .deprecated ("3.4" )
361365 def update_params (self ):
362- """Update the subplot position from fig.subplotpars."""
363- self .figbox = self .get_subplotspec ().get_position (self .figure )
366+ pass
364367
368+ @cbook .deprecated (
369+ "3.4" , alternative = "get_subplotspec" ,
370+ addendum = "(get_subplotspec returns a SubplotSpec instance.)" )
365371 def get_geometry (self ):
366372 """Get the subplot geometry, e.g., (2, 2, 3)."""
367373 rows , cols , num1 , num2 = self .get_subplotspec ().get_geometry ()
368374 return rows , cols , num1 + 1 # for compatibility
369375
370- # COVERAGE NOTE: Never used internally or from examples
376+ @ cbook . deprecated ( "3.4" , alternative = "set_subplotspec" )
371377 def change_geometry (self , numrows , numcols , num ):
372378 """Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3)."""
373379 self ._subplotspec = GridSpec (numrows , numcols )[num - 1 ]
@@ -381,6 +387,7 @@ def get_subplotspec(self):
381387 def set_subplotspec (self , subplotspec ):
382388 """Set the SubplotSpec instance."""
383389 self ._subplotspec = subplotspec
390+ self .set_position (subplotspec .get_position (self .figure ))
384391
385392
386393class AxesDivider (Divider ):
0 commit comments