@@ -61,7 +61,6 @@ def __init__(self, axes, spine_type, path, **kwargs):
6161 self .set_transform (self .axes .transData ) # default transform
6262
6363 self ._bounds = None # default bounds
64- self ._smart_bounds = False # deprecated in 3.2
6564
6665 # Defer initial position determination. (Not much support for
6766 # non-rectangular axes is currently implemented, and this lets
@@ -82,23 +81,6 @@ def __init__(self, axes, spine_type, path, **kwargs):
8281 # Note: This cannot be calculated until this is added to an Axes
8382 self ._patch_transform = mtransforms .IdentityTransform ()
8483
85- @_api .deprecated ("3.2" )
86- def set_smart_bounds (self , value ):
87- """Set the spine and associated axis to have smart bounds."""
88- self ._smart_bounds = value
89-
90- # also set the axis if possible
91- if self .spine_type in ('left' , 'right' ):
92- self .axes .yaxis .set_smart_bounds (value )
93- elif self .spine_type in ('top' , 'bottom' ):
94- self .axes .xaxis .set_smart_bounds (value )
95- self .stale = True
96-
97- @_api .deprecated ("3.2" )
98- def get_smart_bounds (self ):
99- """Return whether the spine has smart bounds."""
100- return self ._smart_bounds
101-
10284 def set_patch_arc (self , center , radius , theta1 , theta2 ):
10385 """Set the spine to be arc-like."""
10486 self ._patch_type = 'arc'
@@ -247,64 +229,14 @@ def _adjust_location(self):
247229 if self .spine_type == 'circle' :
248230 return
249231
250- if self ._bounds is None :
251- if self .spine_type in ('left' , 'right' ):
252- low , high = self .axes .viewLim .intervaly
253- elif self .spine_type in ('top' , 'bottom' ):
254- low , high = self .axes .viewLim .intervalx
255- else :
256- raise ValueError ('unknown spine spine_type: %s' %
257- self .spine_type )
258-
259- if self ._smart_bounds : # deprecated in 3.2
260- # attempt to set bounds in sophisticated way
261-
262- # handle inverted limits
263- viewlim_low , viewlim_high = sorted ([low , high ])
264-
265- if self .spine_type in ('left' , 'right' ):
266- datalim_low , datalim_high = self .axes .dataLim .intervaly
267- ticks = self .axes .get_yticks ()
268- elif self .spine_type in ('top' , 'bottom' ):
269- datalim_low , datalim_high = self .axes .dataLim .intervalx
270- ticks = self .axes .get_xticks ()
271- # handle inverted limits
272- ticks = np .sort (ticks )
273- datalim_low , datalim_high = sorted ([datalim_low , datalim_high ])
274-
275- if datalim_low < viewlim_low :
276- # Data extends past view. Clip line to view.
277- low = viewlim_low
278- else :
279- # Data ends before view ends.
280- cond = (ticks <= datalim_low ) & (ticks >= viewlim_low )
281- tickvals = ticks [cond ]
282- if len (tickvals ):
283- # A tick is less than or equal to lowest data point.
284- low = tickvals [- 1 ]
285- else :
286- # No tick is available
287- low = datalim_low
288- low = max (low , viewlim_low )
289-
290- if datalim_high > viewlim_high :
291- # Data extends past view. Clip line to view.
292- high = viewlim_high
293- else :
294- # Data ends before view ends.
295- cond = (ticks >= datalim_high ) & (ticks <= viewlim_high )
296- tickvals = ticks [cond ]
297- if len (tickvals ):
298- # A tick is greater than or equal to highest data
299- # point.
300- high = tickvals [0 ]
301- else :
302- # No tick is available
303- high = datalim_high
304- high = min (high , viewlim_high )
305-
306- else :
232+ if self ._bounds is not None :
307233 low , high = self ._bounds
234+ elif self .spine_type in ('left' , 'right' ):
235+ low , high = self .axes .viewLim .intervaly
236+ elif self .spine_type in ('top' , 'bottom' ):
237+ low , high = self .axes .viewLim .intervalx
238+ else :
239+ raise ValueError (f'unknown spine spine_type: { self .spine_type } ' )
308240
309241 if self ._patch_type == 'arc' :
310242 if self .spine_type in ('bottom' , 'top' ):
0 commit comments