0
我有一個for循環肚裏如下所示:如何繪製Matplotlib上的多個數據集Axes3D分散而不刪除以前的數據?
for index, t in enumerate(Coords_at_different_energies):
fig0 = pylab.figure(0)
ax0 = Axes3D(fig0)
arr_t = np.array(t)
ax0.scatter(arr_t[:,0], arr_t[:,1], arr_t[:,2], color = colors[index])
pyplot.show()
其中Coords_at_different_energies是座標和顏色的列表的列表是一個顏色列表。
當我運行它時,只有最後要繪製的數據集似乎仍然存在,即我認爲循環會在每次迭代時覆蓋以前的數據集。有沒有辦法解決?