Skip to content

Commit 354dc4e

Browse files
committed
Fix issue where panel() doesn't pass format() args
1 parent a15feb3 commit 354dc4e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

proplot/figure.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,16 @@ def _add_axes_panel(self, ax, side=None, **kwargs):
927927
side = _translate_loc(side, 'panel', default=_not_none(orig, 'right'))
928928

929929
# Add and setup the panel accounting for index changes
930-
# NOTE: Always put tick labels on the 'outside'
930+
# NOTE: Always put tick labels on the 'outside' and permit arbitrary
931+
# keyword arguments passed from the user.
931932
gs = self.gridspec
932933
if not gs:
933934
raise RuntimeError('The gridspec must be active.')
934-
ss, share = gs._insert_panel_slot(side, ax, **kwargs)
935-
pax = self.add_subplot(ss, autoshare=False, number=False)
935+
kw = _pop_params(kwargs, gs._insert_panel_slot)
936+
ss, share = gs._insert_panel_slot(side, ax, **kw)
937+
kwargs['autoshare'] = False
938+
kwargs.setdefault('number', False) # power users might number panels
939+
pax = self.add_subplot(ss, **kwargs)
936940
pax._panel_side = side
937941
pax._panel_share = share
938942
pax._panel_parent = ax
@@ -963,7 +967,8 @@ def _add_figure_panel(
963967
span = _not_none(span=span, col=col, cols=cols)
964968

965969
# Add and setup panel
966-
# NOTE: This relies on panel slot obfuscation built into gridspec
970+
# NOTE: This is only called internally by colorbar and legend so
971+
# do not need to pass aribtrary axes keyword arguments.
967972
gs = self.gridspec
968973
if not gs:
969974
raise RuntimeError('The gridspec must be active.')

proplot/gridspec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,7 @@ def _parse_panel_arg(self, side, arg):
499499
return slot, iratio, slice(start, stop + 1)
500500

501501
def _insert_panel_slot(
502-
self, side, arg, *,
503-
share=None, width=None, space=None, pad=None, filled=False,
502+
self, side, arg, *, share=None, width=None, space=None, pad=None, filled=False,
504503
):
505504
"""
506505
Insert a panel slot into the existing gridspec. The `side` is the panel side

0 commit comments

Comments
 (0)