@@ -169,13 +169,23 @@ def _format_ticks(self, idx, direction, factor, levels):
169169 return (fmt .format_ticks (levels ) if isinstance (fmt , mticker .Formatter )
170170 else fmt (direction , factor , levels ))
171171
172- def get_grid_info (self , x1 , y1 , x2 , y2 ):
172+ def get_grid_info (self , * args , ** kwargs ):
173173 """
174- lon_values, lat_values : list of grid values. if integer is given,
175- rough number of grids in each direction .
174+ Compute positioning information for grid lines and ticks, given the
175+ axes' data *bbox* .
176176 """
177+ params = _api .select_matching_signature (
178+ [lambda x1 , y1 , x2 , y2 : locals (), lambda bbox : locals ()], * args , ** kwargs )
179+ if "x1" in params :
180+ _api .warn_deprecated ("3.11" , message = (
181+ "Passing extents as separate arguments to get_grid_info is deprecated "
182+ "since %(since)s and support will be removed %(removal)s; pass a "
183+ "single bbox instead." ))
184+ bbox = Bbox .from_extents (
185+ params ["x1" ], params ["y1" ], params ["x2" ], params ["y2" ])
186+ else :
187+ bbox = params ["bbox" ]
177188
178- bbox = Bbox .from_extents (x1 , y1 , x2 , y2 )
179189 tbbox = self .extreme_finder ._find_transformed_bbox (
180190 self .get_transform ().inverted (), bbox )
181191
0 commit comments