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

Method _update_gc

lib/matplotlib/patheffects.py:39–57  ·  view source on GitHub ↗

Update the given GraphicsContext with the given dict of properties. The keys in the dictionary are used to identify the appropriate ``set_`` method on the *gc*.

(self, gc, new_gc_dict)

Source from the content-addressed store, hash-verified

37 *map(renderer.points_to_pixels, self._offset))
38
39 def _update_gc(self, gc, new_gc_dict):
40 """
41 Update the given GraphicsContext with the given dict of properties.
42
43 The keys in the dictionary are used to identify the appropriate
44 ``set_`` method on the *gc*.
45 """
46 new_gc_dict = new_gc_dict.copy()
47
48 dashes = new_gc_dict.pop("dashes", None)
49 if dashes:
50 gc.set_dashes(**dashes)
51
52 for k, v in new_gc_dict.items():
53 set_method = getattr(gc, 'set_' + k, None)
54 if not callable(set_method):
55 raise AttributeError(f'Unknown property {k}')
56 set_method(v)
57 return gc
58
59 def draw_path(self, renderer, gc, tpath, affine, rgbFace=None):
60 """

Callers 4

draw_pathMethod · 0.80
draw_pathMethod · 0.80
draw_pathMethod · 0.80
draw_pathMethod · 0.80

Calls 3

copyMethod · 0.45
popMethod · 0.45
set_dashesMethod · 0.45

Tested by

no test coverage detected