Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 304d3d5

Browse filesBrowse files
ImportanceOfBeingErnestMeeseeksDev[bot]
authored andcommitted
Backport PR #12334: Improve selection of inset indicator connectors.
1 parent 2efbdd6 commit 304d3d5
Copy full SHA for 304d3d5

File tree

Expand file treeCollapse file tree

1 file changed

+8
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-10
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+8-10Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -583,16 +583,14 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None,
583583
bboxins = pos.transformed(self.figure.transFigure)
584584
rectbbox = mtransforms.Bbox.from_bounds(
585585
*bounds).transformed(transform)
586-
if rectbbox.x0 < bboxins.x0:
587-
sig = 1
588-
else:
589-
sig = -1
590-
if sig*rectbbox.y0 < sig*bboxins.y0:
591-
connects[0].set_visible(False)
592-
connects[3].set_visible(False)
593-
else:
594-
connects[1].set_visible(False)
595-
connects[2].set_visible(False)
586+
x0 = rectbbox.x0 < bboxins.x0
587+
x1 = rectbbox.x1 < bboxins.x1
588+
y0 = rectbbox.y0 < bboxins.y0
589+
y1 = rectbbox.y1 < bboxins.y1
590+
connects[0].set_visible(x0 ^ y0)
591+
connects[1].set_visible(x0 == y1)
592+
connects[2].set_visible(x1 == y0)
593+
connects[3].set_visible(x1 ^ y1)
596594

597595
return rectpatch, connects
598596

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.