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

Method too_close

lib/matplotlib/contour.py:239–243  ·  view source on GitHub ↗

Return whether a label is already near this location.

(self, x, y, lw)

Source from the content-addressed store, hash-verified

237 and (np.ptp(linecontour, axis=0) > 1.2 * labelwidth).any()))
238
239 def too_close(self, x, y, lw):
240 """Return whether a label is already near this location."""
241 thresh = (1.2 * lw) ** 2
242 return any((x - loc[0]) ** 2 + (y - loc[1]) ** 2 < thresh
243 for loc in self.labelXYs)
244
245 def _get_nth_label_width(self, nth):
246 """Return the width of the *nth* label, in pixels."""

Callers 1

locate_labelMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected