title: How do I generate contour plot from a n x n matrix?
body: <p>I have a n x n matrix called <code>o_potential</code> filled with some values and would like to generate a contour plot out of it. I tried several approaches without any success. This is what I have right now.</p>
  
  <pre><code>n = 20
  x = arange(0,n-1)
  y = arange(0,n-1)
  plt.contourf(x, y, o_potential[x][y])
  plt.show()
  </code></pre>
  
  <p><code>o_potential</code> looks like this</p>
  
  <pre><code>o_potential = [[ -1.,          -1.,          -1.,          -1.,          -1.        ],
   [ 10.,           4.12244898,   2.7755102,    4.12244898,  10.        ],
   [ 10.,           5.7755102,    4.24489796,   5.7755102,   10.        ],
   [ 10.,           4.12244898,   2.7755102,    4.12244898,  10.        ],
   [ -1.,          -1.,          -1.,          -1.,          -1.        ]]
  </code></pre>
  
  <p>I am getting the following error message: "arrays used as indices must be of integer (or boolean) type."</p>
  
  <p>I have been struggling with this from yesterday. I tried almost all the Google results, but couldn't solve the problem. Your help is appreciated!</p>