MCPcopy
hub / github.com/matplotlib/matplotlib / add_patch

Method add_patch

lib/matplotlib/axes/_base.py:2541–2553  ·  view source on GitHub ↗

Add a `.Patch` to the Axes; return the patch.

(self, p)

Source from the content-addressed store, hash-verified

2539 self.ignore_existing_data_limits = False
2540
2541 def add_patch(self, p):
2542 """
2543 Add a `.Patch` to the Axes; return the patch.
2544 """
2545 _api.check_isinstance(mpatches.Patch, p=p)
2546 self._set_artist_props(p)
2547 if p.get_clip_path() is None:
2548 p.set_clip_path(self.patch)
2549 self._update_patch_limits(p)
2550 self._children.append(p)
2551 p._remove_method = self._children.remove
2552 p._set_in_autoscale(True)
2553 return p
2554
2555 def _update_patch_limits(self, patch):
2556 """Update the data limits for the given patch."""

Callers 15

test_patch_modificationFunction · 0.80
test_arc_pathpatchFunction · 0.80
mark_insetFunction · 0.80
test_fill_facecolorFunction · 0.80
addMethod · 0.80
_add_solids_patchesMethod · 0.80
_do_extendsMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80
new_axesMethod · 0.80

Calls 5

_set_artist_propsMethod · 0.95
_update_patch_limitsMethod · 0.95
_set_in_autoscaleMethod · 0.80
get_clip_pathMethod · 0.45
set_clip_pathMethod · 0.45

Tested by 15

test_patch_modificationFunction · 0.64
test_arc_pathpatchFunction · 0.64
test_fill_facecolorFunction · 0.64
plot_pathsFunction · 0.64
test_simplify_curveFunction · 0.64
test_hatchFunction · 0.64
test_path_clippingFunction · 0.64