@@ -1352,15 +1352,9 @@ def plot_surface(self, X, Y, Z, *args, **kwargs):
1352
1352
had_data = self .has_data ()
1353
1353
1354
1354
Z = np .atleast_2d (Z )
1355
- rows , cols = Z .shape
1356
1355
# TODO: Support masked arrays
1357
- X = np .asarray (X )
1358
- Y = np .asarray (Y )
1359
- # Force X and Y to take the same shape.
1360
- # If they can not be fitted to that shape,
1361
- # then an exception is automatically thrown.
1362
- X .shape = (rows , cols )
1363
- Y .shape = (rows , cols )
1356
+ X , Y , Z = np .broadcast_arrays (X , Y , Z )
1357
+ rows , cols = Z .shape
1364
1358
1365
1359
rstride = kwargs .pop ('rstride' , 10 )
1366
1360
cstride = kwargs .pop ('cstride' , 10 )
@@ -1526,14 +1520,8 @@ def plot_wireframe(self, X, Y, Z, *args, **kwargs):
1526
1520
had_data = self .has_data ()
1527
1521
Z = np .atleast_2d (Z )
1528
1522
# FIXME: Support masked arrays
1529
- X = np .asarray (X )
1530
- Y = np .asarray (Y )
1523
+ X , Y , Z = np .broadcast_arrays (X , Y , Z )
1531
1524
rows , cols = Z .shape
1532
- # Force X and Y to take the same shape.
1533
- # If they can not be fitted to that shape,
1534
- # then an exception is automatically thrown.
1535
- X .shape = (rows , cols )
1536
- Y .shape = (rows , cols )
1537
1525
1538
1526
# We want two sets of lines, one running along the "rows" of
1539
1527
# Z and another set of lines running along the "columns" of Z.
0 commit comments