I'm trying to make 3D surface just like in this example: https://gis.stackexchange.com/questions/66367/display-a-georeferenced-dem-surface-in-3d-matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import *
from matplotlib.mlab import griddata
from matplotlib import cm
data = np.random.random((20, 2))
z = np.random.randint(5, 30, 20)
x = data.T[0]
y = data.T[-1]
xi = np.linspace(min(x), max(x))
yi = np.linspace(min(x), max(y))
X, Y = np.meshgrid(xi, yi)
Z = griddata(x, y, z, xi, yi)
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter3D(x, y, z, c=z)
Axes3D.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet, linewidth=1, antialiased=True)
plt.show()
I think my code is similar as the example, but it doesn't work. I got this error
TypeError: plot_surface() missing 1 required positional argument: 'Z'
How can I fix it?
