-2

我的代码目前如下所示:

a = 3
b = 4
c = 0
d = 1
e = 7
f = 6
g = 5

y = (0,1,2,3,4,5,6)
x = (a,b,c,d,e,f,g)
bar(y, x, linewidth = 3)
show()

但我不断收到错误消息:

ValueError: setting an array element with a sequence.

任何想法出了什么问题?

4

1 回答 1

2

我的水晶球暗示你正在尝试使用matplotlib。在这种情况下,将您的xand yfrom更改tupleslists

y = [0,1,2,3,4,5,6]
x = [a,b,c,d,e,f,g]
于 2012-05-09T12:51:39.320 回答