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

Method _check_xy

lib/matplotlib/patches.py:4878–4901  ·  view source on GitHub ↗

Check whether the annotation needs to be drawn.

(self, renderer)

Source from the content-addressed store, hash-verified

4876 return path, fillable
4877
4878 def _check_xy(self, renderer):
4879 """Check whether the annotation needs to be drawn."""
4880
4881 b = self.get_annotation_clip()
4882
4883 if b or (b is None and self.coords1 == "data"):
4884 xy_pixel = self._get_xy(self.xy1, self.coords1, self.axesA)
4885 if self.axesA is None:
4886 axes = self.axes
4887 else:
4888 axes = self.axesA
4889 if not axes.contains_point(xy_pixel):
4890 return False
4891
4892 if b or (b is None and self.coords2 == "data"):
4893 xy_pixel = self._get_xy(self.xy2, self.coords2, self.axesB)
4894 if self.axesB is None:
4895 axes = self.axes
4896 else:
4897 axes = self.axesB
4898 if not axes.contains_point(xy_pixel):
4899 return False
4900
4901 return True
4902
4903 def draw(self, renderer):
4904 if not self.get_visible() or not self._check_xy(renderer):

Callers 1

drawMethod · 0.95

Calls 3

get_annotation_clipMethod · 0.95
_get_xyMethod · 0.95
contains_pointMethod · 0.45

Tested by

no test coverage detected