
Untitled
By: a guest on
Jul 29th, 2012 | syntax:
None | size: 0.52 KB | hits: 16 | expires: Never
Plot problems in Python
y = arange(1, 26, 1)
x = [4,1,8,6,18,2,1,7,11,0,0,1,2,9,12,2,0,5,8,13,1,2,5,0,2,0]
plot(y, x)
[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25]
raise ValueError("x and y must have same first dimension")
ValueError: x and y must have same first dimension
>>> y
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
>>> x
[4, 1, 8, 6, 18, 2, 1, 7, 11, 0, 0, 1, 2, 9, 12, 2, 0, 5, 8, 13, 1, 2, 5, 0, 2, 0]
>>> len(x)
26
>>> len(y)
25