@@ -33,7 +33,10 @@ def __init__(self, grid_helper, side, nth_coord_ticks=None):
33
33
nth_coord = along which coordinate value varies.
34
34
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
35
35
"""
36
- value , nth_coord = grid_helper .get_data_boundary (side )
36
+ lon1 , lon2 , lat1 , lat2 = grid_helper .grid_finder .extreme_finder (* [None ] * 5 )
37
+ value , nth_coord = _api .check_getitem (
38
+ dict (left = (lon1 , 0 ), right = (lon2 , 0 ), bottom = (lat1 , 1 ), top = (lat2 , 1 )),
39
+ side = side )
37
40
super ().__init__ (grid_helper , nth_coord , value , axis_direction = side )
38
41
if nth_coord_ticks is None :
39
42
nth_coord_ticks = nth_coord
@@ -58,7 +61,7 @@ def get_tick_iterators(self, axes):
58
61
lon_levs , lon_n , lon_factor = self ._grid_info ["lon_info" ]
59
62
xx0 = lon_levs / lon_factor
60
63
61
- extremes = self .grid_helper ._extremes
64
+ extremes = self .grid_helper .grid_finder . extreme_finder ( * [ None ] * 5 )
62
65
xmin , xmax = sorted (extremes [:2 ])
63
66
ymin , ymax = sorted (extremes [2 :])
64
67
@@ -137,20 +140,19 @@ def __init__(self, aux_trans, extremes,
137
140
tick_formatter1 = None ,
138
141
tick_formatter2 = None ):
139
142
# docstring inherited
140
- self ._extremes = extremes
141
- extreme_finder = ExtremeFinderFixed (extremes )
142
143
super ().__init__ (aux_trans ,
143
- extreme_finder ,
144
+ extreme_finder = ExtremeFinderFixed ( extremes ) ,
144
145
grid_locator1 = grid_locator1 ,
145
146
grid_locator2 = grid_locator2 ,
146
147
tick_formatter1 = tick_formatter1 ,
147
148
tick_formatter2 = tick_formatter2 )
148
149
150
+ @_api .deprecated ("3.8" )
149
151
def get_data_boundary (self , side ):
150
152
"""
151
153
Return v=0, nth=1.
152
154
"""
153
- lon1 , lon2 , lat1 , lat2 = self ._extremes
155
+ lon1 , lon2 , lat1 , lat2 = self .grid_finder . extreme_finder ( * [ None ] * 5 )
154
156
return dict (left = (lon1 , 0 ),
155
157
right = (lon2 , 0 ),
156
158
bottom = (lat1 , 1 ),
@@ -262,10 +264,7 @@ def __init__(self, *args, grid_helper, **kwargs):
262
264
263
265
def _gen_axes_patch (self ):
264
266
# docstring inherited
265
- # Using a public API to access _extremes.
266
- (x0 , _ ), (x1 , _ ), (y0 , _ ), (y1 , _ ) = map (
267
- self .get_grid_helper ().get_data_boundary ,
268
- ["left" , "right" , "bottom" , "top" ])
267
+ x0 , x1 , y0 , y1 = self .get_grid_helper ().grid_finder .extreme_finder (* [None ] * 5 )
269
268
patch = mpatches .Polygon ([(x0 , y0 ), (x1 , y0 ), (x1 , y1 ), (x0 , y1 )])
270
269
patch .get_path ()._interpolation_steps = 100
271
270
return patch
0 commit comments