0
I have 3 arrays, from the arrays I must draw a 3D graphic. I have tried several ways but I could not. I believe I am not creating the data frames correctly. I’m trying to do it this way:
x = np.array(x_values)
y = np.array(y_values)
X, Y = np.meshgrid(x, y)
Z = np.array(z_values)
ax = plt.axes(projection='3d')
ax.plot_surface(X, Y, Z, rstride=1, cstride=1,cmap='viridis',edgecolor='none')
plt.show()
The code is returning the following error:
Valueerror: Argument Z must be 2-dimensional.
Argument Z must have two dimensions and in the case you put your Z only has one dimension. Take a look at the example on this site: https://matplotlib.org/3.1.1/gallery/mplot3d/surface3d.html
– Hugo Salvador