import matplotlib.pyplot as plt
import numpy as np
# Create some data
x = np.linspace(0, 10, 100)
y = np.linspace(0, 10, 100)
z = np.sin(x) * np.cos(y)
# Mask some of the data
mask = z > 0.5
z = np.ma.array(z, mask=mask)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot(x, y, z)
fig.show()
Currently, all of the data is plotted.