Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c3c61c

Browse files
committed
MNT: use np.argwhere
1 parent 1ed1e3a commit 0c3c61c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,11 +1641,11 @@ def _do_layout(gs, layout, unique_ids, nested):
16411641
covered = np.zeros((rows, cols), dtype=bool)
16421642
output = dict()
16431643

1644-
for j, k in zip(*np.where(layout == empty_sentinal)):
1644+
for j, k in np.argwhere(layout == empty_sentinal):
16451645
covered[j, k] = True
16461646

16471647
for name in unique_ids:
1648-
indx = np.stack(np.where(layout == name)).T
1648+
indx = np.argwhere(layout == name)
16491649
start_row, start_col = np.min(indx, axis=0)
16501650
end_row, end_col = np.max(indx, axis=0) + 1
16511651
slc = (slice(start_row, end_row), slice(start_col, end_col))

0 commit comments

Comments
 (0)