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

Method overlaps

lib/matplotlib/transforms.py:423–441  ·  view source on GitHub ↗

Return whether this bounding box overlaps with the other bounding box. Parameters ---------- other : `.BboxBase`

(self, other)

Source from the content-addressed store, hash-verified

421 return self.containsx(x) and self.containsy(y)
422
423 def overlaps(self, other):
424 """
425 Return whether this bounding box overlaps with the other bounding box.
426
427 Parameters
428 ----------
429 other : `.BboxBase`
430 """
431 ax1, ay1, ax2, ay2 = self.extents
432 bx1, by1, bx2, by2 = other.extents
433 if ax2 < ax1:
434 ax2, ax1 = ax1, ax2
435 if ay2 < ay1:
436 ay2, ay1 = ay1, ay2
437 if bx2 < bx1:
438 bx2, bx1 = bx1, bx2
439 if by2 < by1:
440 by2, by1 = by1, by2
441 return ax1 <= bx2 and bx1 <= ax2 and ay1 <= by2 and by1 <= ay2
442
443 def fully_containsx(self, x):
444 """

Callers 3

__init__Method · 0.80
test_nan_overlapFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_nan_overlapFunction · 0.64