@@ -250,6 +250,8 @@ def new_locator(self, nx, ny, nx1=None, ny1=None):
250
250
ny1 if ny1 is not None else ny + 1 )
251
251
252
252
def append_size (self , position , size ):
253
+ _api .check_in_list (["left" , "right" , "bottom" , "top" ],
254
+ position = position )
253
255
if position == "left" :
254
256
self ._horizontal .insert (0 , size )
255
257
self ._xrefindex += 1
@@ -258,11 +260,8 @@ def append_size(self, position, size):
258
260
elif position == "bottom" :
259
261
self ._vertical .insert (0 , size )
260
262
self ._yrefindex += 1
261
- elif position == " top" :
263
+ else : # ' top'
262
264
self ._vertical .append (size )
263
- else :
264
- _api .check_in_list (["left" , "right" , "bottom" , "top" ],
265
- position = position )
266
265
267
266
def add_auto_adjustable_area (self , use_axes , pad = 0.1 , adjust_dirs = None ):
268
267
"""
@@ -512,6 +511,8 @@ def append_axes(self, position, size, pad=None, add_to_figure=True, *,
512
511
**kwargs
513
512
All extra keywords arguments are passed to the created axes.
514
513
"""
514
+ _api .check_in_list (["left" , "right" , "bottom" , "top" ],
515
+ position = position )
515
516
if position == "left" :
516
517
ax = self .new_horizontal (
517
518
size , pad , pack_start = True , axes_class = axes_class , ** kwargs )
@@ -521,12 +522,9 @@ def append_axes(self, position, size, pad=None, add_to_figure=True, *,
521
522
elif position == "bottom" :
522
523
ax = self .new_vertical (
523
524
size , pad , pack_start = True , axes_class = axes_class , ** kwargs )
524
- elif position == "top" :
525
+ else : # "top"
525
526
ax = self .new_vertical (
526
527
size , pad , pack_start = False , axes_class = axes_class , ** kwargs )
527
- else :
528
- _api .check_in_list (["left" , "right" , "bottom" , "top" ],
529
- position = position )
530
528
if add_to_figure :
531
529
self ._fig .add_axes (ax )
532
530
return ax
0 commit comments