Return whether a label is already near this location.
(self, x, y, lw)
| 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.""" |