matplotlib 3D plot, plot_surface black
Ich habe folgende Daten:https: //www.dropbox.com/s/u7ee09chaixw5vb/draw? dl = 0
it wird mit pickle in python3 gespeichert und ist nur eine zweidimensionale Python-Liste in Form vonz=[[],[],[]...[]]
und ich benutze den folgenden Code, um das 3D-Diagramm zu zeichnen, aber es zeigt mir nur die schwarze Oberfläche. Warum?xydict
kann aus der obigen Datei geladen werden:
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(0, len(xydict))
Y = np.arange(0, len(xydict[0]))
X, Y = np.meshgrid(X, Y)
Z = np.array(xydict).T
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=plt.cm.hot)
# ax.contourf(X, Y, Z, zdir='z', offset=0, cmap=plt.cm.hot)
ax.set_zlim(0,1)
plt.savefig('plot3d_ex.png', dpi=480)