Skip to content

Commit 678e912

Browse files
committed
Allow NaNs and masked arrays in plot_surface
1 parent 50e9cbb commit 678e912

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,12 +1574,8 @@ def plot_surface(self, X, Y, Z, *args, norm=None, vmin=None,
15741574

15751575
if Z.ndim != 2:
15761576
raise ValueError("Argument Z must be 2-dimensional.")
1577-
if np.any(np.isnan(Z)):
1578-
_api.warn_external(
1579-
"Z contains NaN values. This may result in rendering "
1580-
"artifacts.")
15811577

1582-
# TODO: Support masked arrays
1578+
Z = cbook._to_unmasked_float_array(Z)
15831579
X, Y, Z = np.broadcast_arrays(X, Y, Z)
15841580
rows, cols = Z.shape
15851581

0 commit comments

Comments
 (0)