【发布时间】:2020-12-25 10:16:33
【问题描述】:
x = [2000,2001,2002,2003]
y = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
for i in range(len(y[0])):
plt.plot(x,[pt[i] for pt in y])
plt.show()
我收到了ValueError 的4, 3。我知道x 和y 必须相等。我认为len(y[0]) 会起作用。
对于y 中的每个子列表,我想生成一行,其x 值对应于2000, 2001, 2002, 2003。
【问题讨论】:
标签: python matplotlib valueerror