Skip to content

Commit

Permalink
Fix issue with deprecated rc param/keyword conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Oct 11, 2021
1 parent 803a889 commit ff1205a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion proplot/internals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,20 @@ def _pop_rc(src):
"""
Pop the rc setting names and mode for a `~Configurator.context` block.
"""
# NOTE: Must ignore deprected or conflicting rc params
# NOTE: rc_mode == 2 applies only the updated params. A power user
# could use ax.format(rc_mode=0) to re-apply all the current settings
ignore_params = (
'alpha',
'color',
'facecolor',
'edgecolor',
'linewidth',
'share',
'span',
'tight',
'span',
)
kw = src.pop('rc_kw', None) or {}
if 'mode' in src:
src['rc_mode'] = src.pop('mode')
Expand All @@ -356,7 +368,7 @@ def _pop_rc(src):
mode = _not_none(mode, 2) # only apply updated params by default
for key, value in tuple(src.items()):
name = rcsetup._rc_nodots.get(key, None)
if name in ('alpha', 'color', 'facecolor', 'edgecolor', 'linewidth'):
if name in ignore_params:
name = None # former renamed settings
if name is not None:
kw[name] = src.pop(key)
Expand Down

0 comments on commit ff1205a

Please sign in to comment.