@@ -214,8 +214,16 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
214
214
x0 , y0 = x , y
215
215
216
216
if nx1 is None :
217
+ _api .warn_deprecated (
218
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
219
+ "deprecated since %(since)s; in a future version, nx1=None "
220
+ "will mean 'up to the last cell'." )
217
221
nx1 = nx + 1
218
222
if ny1 is None :
223
+ _api .warn_deprecated (
224
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
225
+ "deprecated since %(since)s; in a future version, ny1=None "
226
+ "will mean 'up to the last cell'." )
219
227
ny1 = ny + 1
220
228
221
229
x1 , w1 = x0 + ox [nx ] / fig_w , (ox [nx1 ] - ox [nx ]) / fig_w
@@ -237,7 +245,10 @@ def new_locator(self, nx, ny, nx1=None, ny1=None):
237
245
ny, ny1 : int
238
246
Same as *nx* and *nx1*, but for row positions.
239
247
"""
240
- return AxesLocator (self , nx , ny , nx1 , ny1 )
248
+ return AxesLocator (
249
+ self , nx , ny ,
250
+ nx1 if nx1 is not None else nx + 1 ,
251
+ ny1 if ny1 is not None else ny + 1 )
241
252
242
253
def append_size (self , position , size ):
243
254
if position == "left" :
@@ -267,9 +278,10 @@ def add_auto_adjustable_area(self, use_axes, pad=0.1, adjust_dirs=None):
267
278
268
279
class AxesLocator :
269
280
"""
270
- A simple callable object, initialized with AxesDivider class,
271
- returns the position and size of the given cell.
281
+ A callable object which returns the position and size of a given
282
+ AxesDivider cell.
272
283
"""
284
+
273
285
def __init__ (self , axes_divider , nx , ny , nx1 = None , ny1 = None ):
274
286
"""
275
287
Parameters
@@ -291,8 +303,16 @@ def __init__(self, axes_divider, nx, ny, nx1=None, ny1=None):
291
303
self ._nx , self ._ny = nx - _xrefindex , ny - _yrefindex
292
304
293
305
if nx1 is None :
306
+ _api .warn_deprecated (
307
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
308
+ "deprecated since %(since)s; in a future version, nx1=None "
309
+ "will mean 'up to the last cell'." )
294
310
nx1 = nx + 1
295
311
if ny1 is None :
312
+ _api .warn_deprecated (
313
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
314
+ "deprecated since %(since)s; in a future version, ny1=None "
315
+ "will mean 'up to the last cell'." )
296
316
ny1 = ny + 1
297
317
298
318
self ._nx1 = nx1 - _xrefindex
@@ -645,7 +665,7 @@ def new_locator(self, nx, nx1=None):
645
665
specified. Otherwise location of columns spanning between *nx*
646
666
to *nx1* (but excluding *nx1*-th column) is specified.
647
667
"""
648
- return AxesLocator (self , nx , 0 , nx1 , None )
668
+ return AxesLocator (self , nx , 0 , nx1 if nx1 is not None else nx + 1 , 1 )
649
669
650
670
def locate (self , nx , ny , nx1 = None , ny1 = None , axes = None , renderer = None ):
651
671
# docstring inherited
@@ -656,6 +676,10 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
656
676
x0 , y0 , ox , hh = _locate (
657
677
x , y , w , h , summed_ws , equal_hs , fig_w , fig_h , self .get_anchor ())
658
678
if nx1 is None :
679
+ _api .warn_deprecated (
680
+ "3.5" , message = "Support for passing nx1=None to mean nx+1 is "
681
+ "deprecated since %(since)s; in a future version, nx1=None "
682
+ "will mean 'up to the last cell'." )
659
683
nx1 = nx + 1
660
684
x1 , w1 = x0 + ox [nx ] / fig_w , (ox [nx1 ] - ox [nx ]) / fig_w
661
685
y1 , h1 = y0 , hh
@@ -680,7 +704,7 @@ def new_locator(self, ny, ny1=None):
680
704
specified. Otherwise location of rows spanning between *ny*
681
705
to *ny1* (but excluding *ny1*-th row) is specified.
682
706
"""
683
- return AxesLocator (self , 0 , ny , None , ny1 )
707
+ return AxesLocator (self , 0 , ny , 1 , ny1 if ny1 is not None else ny + 1 )
684
708
685
709
def locate (self , nx , ny , nx1 = None , ny1 = None , axes = None , renderer = None ):
686
710
# docstring inherited
@@ -691,6 +715,10 @@ def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
691
715
y0 , x0 , oy , ww = _locate (
692
716
y , x , h , w , summed_hs , equal_ws , fig_h , fig_w , self .get_anchor ())
693
717
if ny1 is None :
718
+ _api .warn_deprecated (
719
+ "3.5" , message = "Support for passing ny1=None to mean ny+1 is "
720
+ "deprecated since %(since)s; in a future version, ny1=None "
721
+ "will mean 'up to the last cell'." )
694
722
ny1 = ny + 1
695
723
x1 , w1 = x0 , ww
696
724
y1 , h1 = y0 + oy [ny ] / fig_h , (oy [ny1 ] - oy [ny ]) / fig_h
0 commit comments