【发布时间】:2022-01-12 08:53:13
【问题描述】:
我的数据如下所示:
[
[1, 2, 3, 4, 5], #x
[6, 7, 8, 9, 0], #y
[[1, 2, 3], [0, 2, 3], [1, 7, 3], [1, 2, 9], [1, 1, 3]] #z is 3 values for each one value in x and y
]
如何在 matplotlib 中绘制/可视化此类数据?
我尝试了以下但没有成功:
ax.scatter3D(data[0], data[1], data[2], c=data[2], cmap='Greens');
# and
ax.plot3D(data[0], data[1], data[2], 'gray')
它给了我错误:
# first line ==> ValueError: shape mismatch: objects cannot be broadcast to a single shape
# second line ==> ValueError: input operand has more dimensions than allowed by the axis remapping
【问题讨论】:
标签: python matplotlib multidimensional-array