8000 Only try to extend rii and cii when not empty · matplotlib/matplotlib@ba1e339 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba1e339

Browse files
committed
Only try to extend rii and cii when not empty
1 parent 994f167 commit ba1e339

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,19 +1750,19 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
17501750

17511751
if rstride:
17521752
rii = list(xrange(0, rows, rstride))
1753+
# Add the last index only if needed
1754+
if rows > 0 and rii[-1] != (rows - 1) :
1755+
rii += [rows-1]
17531756
else:
17541757
rii = []
1755-
if cstride:
1758+
if cstride:
17561759
cii = list(xrange(0, cols, cstride))
1760+
# Add the last index only if needed
1761+
if cols > 0 and cii[-1] != (cols - 1) :
1762+
cii += [cols-1]
17571763
else:
17581764
cii = []
17591765

1760-
# Add the last index only if needed
1761-
if rows > 0 and rii[-1] != (rows - 1) :
1762-
rii += [rows-1]
1763-
if cols > 0 and cii[-1] != (cols - 1) :
1764-
cii += [cols-1]
1765-
17661766
# If the inputs were empty, then just
17671767
# reset everything.
17681768
if Z.size == 0 :

0 commit comments

Comments
 (0)
0