@@ -222,8 +222,16 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
222
222
x0 , y0 = x , y
223
223
224
224
if nx1 is None :
225
+ _api .warn_deprecated (
226
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
227
+ "deprecated since %(since)s; in a future version, nx1=None "
228
+ "will mean 'up to the last cell'." )
225
229
nx1 = nx + 1
226
230
if ny1 is None :
231
+ _api .warn_deprecated (
232
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
233
+ "deprecated since %(since)s; in a future version, ny1=None "
234
+ "will mean 'up to the last cell'." )
227
235
ny1 = ny + 1
228
236
229
237
x1 , w1 = x0 + ox [nx ] / figW , (ox [nx1 ] - ox [nx ]) / figW
@@ -245,7 +253,10 @@ def new_locator(self, nx, ny, nx1=None, ny1=None):
245
253
ny, ny1 : int
246
254
Same as *nx* and *nx1*, but for row positions.
247
255
"""
248
- return AxesLocator (self , nx , ny , nx1 , ny1 )
256
+ return AxesLocator (
257
+ self , nx , ny ,
258
+ nx1 if nx1 is not None else nx + 1 ,
259
+ ny1 if ny1 is not None else ny + 1 )
249
260
250
261
def append_size (self , position , size ):
251
262
if position == "left" :
@@ -275,9 +286,10 @@ def add_auto_adjustable_area(self, use_axes, pad=0.1, adjust_dirs=None):
275
286
276
287
class AxesLocator :
277
288
"""
278
- A simple callable object, initialized with AxesDivider class,
279
- returns the position and size of the given cell.
289
+ A callable object which returns the position and size of a given
290
+ AxesDivider cell.
280
291
"""
292
+
281
293
def __init__ (self , axes_divider , nx , ny , nx1 = None , ny1 = None ):
282
294
"""
283
295
Parameters
@@ -299,8 +311,16 @@ def __init__(self, axes_divider, nx, ny, nx1=None, ny1=None):
299
311
self ._nx , self ._ny = nx - _xrefindex , ny - _yrefindex
300
312
301
313
if nx1 is None :
314
+ _api .warn_deprecated (
315
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
316
+ "deprecated since %(since)s; in a future version, nx1=None "
317
+ "will mean 'up to the last cell'." )
302
318
nx1 = nx + 1
303
319
if ny1 is None :
320
+ _api .warn_deprecated (
321
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
322
+ "deprecated since %(since)s; in a future version, ny1=None "
323
+ "will mean 'up to the last cell'." )
304
324
ny1 = ny + 1
305
325
306
326
self ._nx1 = nx1 - _xrefindex
@@ -629,7 +649,7 @@ def new_locator(self, nx, nx1=None):
629
649
specified. Otherwise location of columns spanning between *nx*
630
650
to *nx1* (but excluding *nx1*-th column) is specified.
631
651
"""
632
- return AxesLocator (self , nx , 0 , nx1 , None )
652
+ return AxesLocator (self , nx , 0 , nx1 if nx1 is not None else nx + 1 , 1 )
633
653
634
654
def _locate (self , x , y , w , h ,
635
655
y_equivalent_sizes , x_appended_sizes ,
@@ -666,6 +686,10 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
666
686
y_equivalent_sizes , x_appended_sizes ,
667
687
figW , figH )
668
688
if nx1 is None :
689
+ _api .warn_deprecated (
690
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
691
+ "deprecated since %(since)s; in a future version, nx1=None "
692
+ "will mean 'up to the last cell'." )
669
693
nx1 = nx + 1
670
694
671
695
x1 , w1 = x0 + ox [nx ] / figW , (ox [nx1 ] - ox [nx ]) / figW
@@ -691,7 +715,7 @@ def new_locator(self, ny, ny1=None):
691
715
specified. Otherwise location of rows spanning between *ny*
692
716
to *ny1* (but excluding *ny1*-th row) is specified.
693
717
"""
694
- return AxesLocator (self , 0 , ny , None , ny1 )
718
+ return AxesLocator (self , 0 , ny , 1 , ny1 if ny1 is not None else ny + 1 )
695
719
696
720
def locate (self , nx , ny , nx1 = None , ny1 = None , axes = None , renderer = None ):
697
721
# docstring inherited
@@ -704,6 +728,10 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
704
728
x_equivalent_sizes , y_appended_sizes ,
705
729
figH , figW )
706
730
if ny1 is None :
731
+ _api .warn_deprecated (
732
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
733
+ "deprecated since %(since)s; in a future version, ny1=None "
734
+ "will mean 'up to the last cell'." )
707
735
ny1 = ny + 1
708
736
709
737
x1 , w1 = x0 , ww
0 commit comments