Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d44b25b

Browse files
committed
Validate axis label keyword props (fixes #366)
1 parent 0e18bab commit d44b25b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎proplot/config.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,20 +1136,20 @@ def _get_label_props(self, native=True, **kwargs):
11361136
based on the context.
11371137
"""
11381138
# Get the label settings
1139-
# NOTE: This permits passing arbitrary additional args to set_[xy]label()
1139+
# NOTE: This permits passing arbitrary additional args to set_[xy]label().
11401140
context = native or self._context_mode == 2
1141-
kw = self.fill(
1142-
{
1143-
'color': 'axes.labelcolor',
1144-
'weight': 'axes.labelweight',
1145-
'size': 'axes.labelsize',
1146-
'family': 'font.family',
1147-
'labelpad': 'axes.labelpad', # read by set_xlabel/set_ylabel
1148-
},
1149-
context=context,
1150-
)
1141+
props = {
1142+
'color': 'axes.labelcolor',
1143+
'weight': 'axes.labelweight',
1144+
'size': 'axes.labelsize',
1145+
'family': 'font.family',
1146+
'labelpad': 'axes.labelpad', # read by set_xlabel/set_ylabel
1147+
}
1148+
kw = self.fill(props, context=context)
11511149
for key, value in kwargs.items():
11521150
if value is not None: # allow e.g. color=None
1151+
if key in props:
1152+
value = self._validate_value(props[key], value)
11531153
kw[key] = value
11541154
return kw
11551155

0 commit comments

Comments
 (0)