Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Plot problems in Python
  2. y = arange(1, 26, 1)
  3. 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]
  4. plot(y, x)
  5.        
  6. [ 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]
  7.        
  8. raise ValueError("x and y must have same first dimension")
  9. ValueError: x and y must have same first dimension
  10.        
  11. >>> y
  12. [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]
  13. >>> x
  14. [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]
  15. >>> len(x)
  16. 26
  17. >>> len(y)
  18. 25