Skip to content

Commit 3fb9a52

Browse files
committed
Rename _panel_kwargs --> _get_panelargs
1 parent 3c44865 commit 3fb9a52

File tree

1 file changed

+6
-29
lines changed

1 file changed

+6
-29
lines changed

proplot/subplots.py

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
619594
def _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

Comments
 (0)