@@ -250,6 +250,8 @@ def new_locator(self, nx, ny, nx1=None, ny1=None):
250250 ny1 if ny1 is not None else ny + 1 )
251251
252252 def append_size (self , position , size ):
253+ _api .check_in_list (["left" , "right" , "bottom" , "top" ],
254+ position = position )
253255 if position == "left" :
254256 self ._horizontal .insert (0 , size )
255257 self ._xrefindex += 1
@@ -258,11 +260,8 @@ def append_size(self, position, size):
258260 elif position == "bottom" :
259261 self ._vertical .insert (0 , size )
260262 self ._yrefindex += 1
261- elif position == " top" :
263+ else : # ' top'
262264 self ._vertical .append (size )
263- else :
264- _api .check_in_list (["left" , "right" , "bottom" , "top" ],
265- position = position )
266265
267266 def add_auto_adjustable_area (self , use_axes , pad = 0.1 , adjust_dirs = None ):
268267 """
@@ -512,6 +511,8 @@ def append_axes(self, position, size, pad=None, add_to_figure=True, *,
512511 **kwargs
513512 All extra keywords arguments are passed to the created axes.
514513 """
514+ _api .check_in_list (["left" , "right" , "bottom" , "top" ],
515+ position = position )
515516 if position == "left" :
516517 ax = self .new_horizontal (
517518 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, *,
521522 elif position == "bottom" :
522523 ax = self .new_vertical (
523524 size , pad , pack_start = True , axes_class = axes_class , ** kwargs )
524- elif position == "top" :
525+ else : # "top"
525526 ax = self .new_vertical (
526527 size , pad , pack_start = False , axes_class = axes_class , ** kwargs )
527- else :
528- _api .check_in_list (["left" , "right" , "bottom" , "top" ],
529- position = position )
530528 if add_to_figure :
531529 self ._fig .add_axes (ax )
532530 return ax
0 commit comments