【发布时间】:2021-05-16 17:22:18
【问题描述】:
我想在一个 3D 散点图中绘制两个数据框。
这是我用于一个数据帧的代码:
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
...
sns.set(style = "darkgrid")
fig = plt.figure()
ax = fig.add_subplot(111, projection = '3d')
x = df['xitem']
y = df['yitem']
z = df['zitem']
ax.set_xlabel("X Label")
ax.set_ylabel("Y Label")
ax.set_zlabel("Z Label")
ax.scatter(x, y, z)
plt.show()
我不知道如何调整它,所以我在同一个图上绘制了两个不同的数据框,但颜色不同。我该怎么做?
编辑:我正在寻找如何将两个数据框用于 3D 绘图。
【问题讨论】:
标签: python python-3.x pandas matplotlib seaborn