Skip to content

Commit

Permalink
Validate axis label keyword props (fixes #366)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Mar 31, 2023
1 parent 0e18bab commit d44b25b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions proplot/config.py
Expand Up @@ -1136,20 +1136,20 @@ def _get_label_props(self, native=True, **kwargs):
based on the context.
"""
# Get the label settings
# NOTE: This permits passing arbitrary additional args to set_[xy]label()
# NOTE: This permits passing arbitrary additional args to set_[xy]label().
context = native or self._context_mode == 2
kw = self.fill(
{
'color': 'axes.labelcolor',
'weight': 'axes.labelweight',
'size': 'axes.labelsize',
'family': 'font.family',
'labelpad': 'axes.labelpad', # read by set_xlabel/set_ylabel
},
context=context,
)
props = {
'color': 'axes.labelcolor',
'weight': 'axes.labelweight',
'size': 'axes.labelsize',
'family': 'font.family',
'labelpad': 'axes.labelpad', # read by set_xlabel/set_ylabel
}
kw = self.fill(props, context=context)
for key, value in kwargs.items():
if value is not None: # allow e.g. color=None
if key in props:
value = self._validate_value(props[key], value)
kw[key] = value
return kw

Expand Down

0 comments on commit d44b25b

Please sign in to comment.