@@ -591,31 +591,6 @@ def _get_space(key, share=0, pad=None):
591591 return space
592592
593593
594- def _get_panelargs (
595- side , share = None , width = None , space = None ,
596- filled = False , figure = False ):
597- """Converts global keywords like `space` and `width` to side-local
598- keywords like `lspace` and `lwidth`, and applies default settings."""
599- # Return values
600- # NOTE: Make default legend width same as default colorbar width, in
601- # case user draws legend and colorbar panel in same row or column!
602- s = side [0 ]
603- if s not in 'lrbt' :
604- raise ValueError (f'Invalid panel spec { side !r} .' )
605- space_orig = units (space )
606- if filled :
607- default = rc ['colorbar.width' ]
608- else :
609- default = rc ['subplots.panelwidth' ]
610- share = _notNone (share , (not filled ))
611- width = units (_notNone (width , default ))
612- space = _notNone (units (space ), units (rc ['subplots.' + (
613- 'panel' if share and not figure
614- else 'xlab' if s == 'b' else 'ylab' if s == 'l'
615- else 'inner' if figure else 'panel' ) + 'space' ]))
616- return share , width , space , space_orig
617-
618-
619594def _subplots_geometry (** kwargs ):
620595 """Save arguments passed to `subplots`, calculates gridspec settings and
621596 figure size necessary for requested geometry, and returns keyword args
@@ -919,8 +894,9 @@ def _add_axes_panel(self, ax, side, filled=False, **kwargs):
919894 raise ValueError (f'Invalid side { side !r} .' )
920895 ax = ax ._panel_parent or ax # redirect to main axes
921896 side = SIDE_TRANSLATE [s ]
922- share , width , space , space_orig = _panels_kwargs (
923- s , filled = filled , figure = False , ** kwargs )
897+ share , width , space , space_orig = _get_panelargs (
898+ s , filled = filled , figure = False , ** kwargs
899+ )
924900
925901 # Get gridspec and subplotspec indices
926902 subplotspec = ax .get_subplotspec ()
@@ -975,8 +951,9 @@ def _add_figure_panel(self, side,
975951 if s not in 'lrbt' :
976952 raise ValueError (f'Invalid side { side !r} .' )
977953 side = SIDE_TRANSLATE [s ]
978- _ , width , space , space_orig = _panels_kwargs (
979- s , filled = True , figure = True , ** kwargs )
954+ _ , width , space , space_orig = _get_panelargs (
955+ s , filled = True , figure = True , ** kwargs
956+ )
980957 if s in 'lr' :
981958 for key , value in (('col' , col ), ('cols' , cols )):
982959 if value is not None :
0 commit comments