MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _update_props

Method _update_props

lib/matplotlib/artist.py:1254–1278  ·  view source on GitHub ↗

Helper for `.Artist.set` and `.Artist.update`. *errfmt* is used to generate error messages for invalid property names; it gets formatted with ``type(self)`` for "{cls}" and the property name for "{prop_name}".

(self, props, errfmt)

Source from the content-addressed store, hash-verified

1252 return ArtistInspector(self).properties()
1253
1254 def _update_props(self, props, errfmt):
1255 """
1256 Helper for `.Artist.set` and `.Artist.update`.
1257
1258 *errfmt* is used to generate error messages for invalid property
1259 names; it gets formatted with ``type(self)`` for "{cls}" and the
1260 property name for "{prop_name}".
1261 """
1262 ret = []
1263 for k, v in props.items():
1264 # Allow attributes we want to be able to update through
1265 # art.update, art.set, setp.
1266 if k == "axes":
1267 ret.append(setattr(self, k, v))
1268 else:
1269 func = getattr(self, f"set_{k}", None)
1270 if not callable(func):
1271 raise AttributeError(
1272 errfmt.format(cls=type(self), prop_name=k),
1273 name=k)
1274 ret.append(func(v))
1275 if ret:
1276 self.pchanged()
1277 self.stale = True
1278 return ret
1279
1280 def update(self, props):
1281 """

Callers 2

updateMethod · 0.95
_internal_updateMethod · 0.95

Calls 2

pchangedMethod · 0.95
funcFunction · 0.50

Tested by

no test coverage detected