【发布时间】:2020-06-02 11:09:26
【问题描述】:
我有这段代码,其中 c_X,c_Y,c_Z,X,Y,Z X_2,Y_2,Z_2,X_4,Y_4,Z_4 是点列表(我的数据)。
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
for i in range (2):
fig = plt.figure(i)
ax = fig.add_subplot(111, projection='3d')
ax.scatter(c_X,c_Y,c_Z, color = 'midnightblue')
ax.scatter(X, Y, Z, color = 'mediumaquamarine')
ax.scatter(X_2,Y_2,Z_2, color = 'cadetblue')
ax.scatter(X_4,Y_4,Z_4, color = 'cadetblue')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.draw()
我到底如何才能持有或获得 3 个不同数字的 3 个地块?
【问题讨论】:
-
尝试将
plt.draw()的缩进减少一级,并可能将其更改为plt.plot()
标签: python matplotlib plot figure