Skip to content

Commit 168ce3a

Browse files
committed
Small cleanup
1 parent 85ce7c5 commit 168ce3a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1566,12 +1566,12 @@ def plot_surface(self, X, Y, Z, *args, norm=None, vmin=None,
15661566
cpadding = cstride - crem if crem != 0 else 0
15671567

15681568
def pad_for_patches(a):
1569+
if cpadding == 0 and rpadding == 0:
1570+
return a
15691571
result = np.empty_like(a, shape=(rows + rpadding, cols + cpadding))
15701572
result[:rows, :cols] = a
1571-
if cpadding:
1572-
result[:rows, -cpadding:] = a[:, -1:]
1573-
if rpadding:
1574-
result[-rpadding:, :cols] = a[-1:, :]
1573+
result[:rows, cols:] = a[:, -1:]
1574+
result[rows:, :cols] = a[-1:, :]
15751575
result[rows:, cols:] = a[-1, -1]
15761576
return result
15771577

0 commit comments

Comments
 (0)