@@ -240,7 +240,6 @@ def __init__(self,
240240 self .clf ()
241241
242242 self ._cachedRenderer = None
243- self ._autoLayout = rcParams ['figure.autolayout' ]
244243
245244 def _get_dpi (self ):
246245 return self ._dpi
@@ -250,9 +249,6 @@ def _set_dpi(self, dpi):
250249 self .callbacks .process ('dpi_changed' , self )
251250 dpi = property (_get_dpi , _set_dpi )
252251
253- def enable_auto_layout (self , setting = True ):
254- self ._autoLayout = setting
255-
256252 def autofmt_xdate (self , bottom = 0.2 , rotation = 30 , ha = 'right' ):
257253 """
258254 Date ticklabels often overlap, so it is useful to rotate them
@@ -284,7 +280,7 @@ def autofmt_xdate(self, bottom=0.2, rotation=30, ha='right'):
284280 label .set_visible (False )
285281 ax .set_xlabel ('' )
286282
287- if allsubplots and not self . _autoLayout :
283+ if allsubplots :
288284 self .subplots_adjust (bottom = bottom )
289285
290286 def get_children (self ):
@@ -765,62 +761,6 @@ def draw(self, renderer):
765761 renderer .draw_image (l , b , im , self .bbox ,
766762 * self .get_transformed_clip_path_and_affine ())
767763
768- # update the positions of the axes
769- # This gives each of the axes the opportunity to resize itself
770- # based on the tick and axis labels etc., and then makes sure
771- # that any axes that began life aligned to another axes remains
772- # aligned after these adjustments
773- if self ._autoLayout and len (self .axes ) > 1 :
774- aligned_positions = [{}, {}, {}, {}]
775- sizes = [{}, {}]
776- for a in self .axes :
777- a .update_layout (renderer )
778- orig_pos = a .get_position (True )
779- curr_pos = a .get_position ()
780- for pos , orig , curr in zip (aligned_positions ,
781- orig_pos .get_points ().flatten (),
782- curr_pos .get_points ().flatten ()):
783- if orig in pos :
784- pos [orig ][0 ].append (a )
785- pos [orig ][1 ].add (curr )
786- else :
787- pos [orig ] = [[a ], set ([curr ])]
788- for size , orig , curr in zip (sizes ,
789- orig_pos .size ,
790- curr_pos .size ):
791- orig = round (orig * 1000.0 ) / 1000.0
792- if orig in size :
793- size [orig ][0 ].append (a )
794- size [orig ][1 ].add (curr )
795- else :
796- size [orig ] = [[a ], set ([curr ])]
797-
798- for i , pos in enumerate (aligned_positions ):
799- for axes , places in pos .values ():
800- if len (places ) > 1 :
801- if i < 2 :
802- curr = max (places )
803- else :
804- curr = min (places )
805- for a in axes :
806- curr_pos = a .get_position ().frozen ()
807- curr_pos .get_points ()[i / 2 , i % 2 ] = curr
808- a .set_position (curr_pos , 'active' )
809-
810- for i , size in enumerate (sizes ):
811- for axes , dims in size .values ():
812- new = min (dims )
813- for a in axes :
814- curr_pos = a .get_position ().frozen ()
815- curr = curr_pos .size [i ]
816- if curr > new :
817- extra = (curr - new ) * 0.5
818- curr_pos .get_points ()[0 , i ] += extra
819- curr_pos .get_points ()[1 , i ] -= extra
820- a .set_position (curr_pos , 'active' )
821- elif self ._autoLayout :
822- for a in self .axes : a .update_layout (renderer )
823-
824764 # render the axes
825765 for a in self .axes : a .draw (renderer )
826766
0 commit comments