I am trying for first time to plot 3d chart and failing measurably. Getting error "Argument Z must be 2-dimensional." Not sure what should I do to make this work. I can plot sold items against both other arguments, thought it will catch this. Will appreciate any help and explanation. Dataset records sale each hour.
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
fig = plt.figure()
ax = fig.gca(projection='3d')
X = dataset['WeekDay']
Y = dataset['Hour']
Z = dataset['SoldItems']
ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
cset = ax.contourf(X, Y, Z, zdir='z', offset=0, cmap=cm.coolwarm)
cset = ax.contourf(X, Y, Z, zdir='x', offset=0, cmap=cm.coolwarm)
cset = ax.contourf(X, Y, Z, zdir='y', offset=0, cmap=cm.coolwarm)
ax.set_xlabel('X')
ax.set_xlim(0, 6)
ax.set_ylabel('Y')
ax.set_ylim(0, 23)
ax.set_zlabel('Z')
ax.set_zlim(0, 1000)
plt.show()