title: Create graphic from array
body: <p>the following code does not work and I can not fix it, someone could help me? The error that comes out is as follows. What this should do is draw in a window all the points of the array, with time being the X and the value being Y, but when passing it through a loop it fails.</p>
  <pre><code>    pt = Point(array2[x], 100)
  IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
  
  </code></pre>
  <p>Code</p>
  <pre><code>import numpy as np
  from graphics import *
  
  arrayX = []
  arrayY = []
  
  win = GraphWin(width = 600, height = 300) # create a window
  
  
  arrayX = np.loadtxt(&quot;time.txt&quot;)
  arrayY = np.loadtxt(&quot;value.txt&quot;)
  
  array2 = arrayX.astype(int)
  print(type(array2[2]))
  
  for x in arrayX:
      pt = Point(x, arrayY[x])
      pt.draw(win)
  
  win.getMouse()
  </code></pre>
  <p>time.txt</p>
  <pre><code>1
  1
  1
  1
  1
  1
  7
  100
  22
  </code></pre>
  <p>value.txt</p>
  <pre><code>100
  100
  50
  20
  34
  67
  23
  89
  43
  </code></pre>