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

Method _cm_set

lib/matplotlib/artist.py:1324–1336  ·  view source on GitHub ↗

A context manager to temporarily set artist properties. In contrast to `.Artist.set` and for performance, this skips the `normalize_kwargs` check.

(self, **kwargs)

Source from the content-addressed store, hash-verified

1322
1323 @contextlib.contextmanager
1324 def _cm_set(self, **kwargs):
1325 """
1326 A context manager to temporarily set artist properties.
1327
1328 In contrast to `.Artist.set` and for performance, this skips the
1329 `normalize_kwargs` check.
1330 """
1331 orig_vals = {k: getattr(self, f"get_{k}")() for k in kwargs}
1332 try:
1333 self._internal_update({k: kwargs[k] for k in orig_vals})
1334 yield
1335 finally:
1336 self._internal_update(orig_vals)
1337
1338 def findobj(self, match=None, include_self=True):
1339 """

Callers 7

update_backgroundMethod · 0.80
find_nearest_contourMethod · 0.80
drawMethod · 0.80
print_figureMethod · 0.80
redraw_in_frameMethod · 0.80

Calls 1

_internal_updateMethod · 0.95

Tested by

no test coverage detected