diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index d76759aa5209..7a66e3760c53 100755 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -1741,8 +1741,14 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs): # This transpose will make it easy to obtain the columns. tX, tY, tZ = np.transpose(X), np.transpose(Y), np.transpose(Z) - rii = list(xrange(0, rows, rstride)) - cii = list(xrange(0, cols, cstride)) + if rstride: + rii = list(xrange(0, rows, rstride)) + else: + rii = [] + if cstride: + cii = list(xrange(0, cols, cstride)) + else: + cii = [] # Add the last index only if needed if rows > 0 and rii[-1] != (rows - 1) :