title: matplotlib pcolormesh plot from x,y,z data
body: <p>I have data in a textfile in tableform with three columns. I use np.genfromtxt to read all the columns into matplotlib as x, y, z.</p>
  
  <p>I want to create a color meshplot where x and y are the coordinates and z represents the color, i think people refer to such a plot as heatmap.</p>
  
  <p>My code is as follows: </p>
  
  <pre><code>x = np.genfromtxt('mesh.txt', dtype=float, delimiter=' ', usecols = (0))
  y = np.genfromtxt('mesh.txt', dtype=float, delimiter=' ', usecols = (1))
  z = np.genfromtxt('mesh.txt', dtype=float, delimiter=' ', usecols = (2))
  
  xmesh, ymesh = np.meshgrid(x,y)
  diagram1.pcolormesh(xmesh,ymesh,z)   
  </code></pre>
  
  <p>But I get the following error message:</p>
  
  <pre><code>line 7154, in pcolormesh
  C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at
  IndexError: too many indices
  </code></pre>
  
  <p>The textfile is as follows:</p>
  
  <pre><code>1 1 5
  2 1 4
  3 1 2
  4 1 6
  1 2 6
  2 2 2
  3 2 1
  4 2 9
  1 3 7
  2 3 4
  3 3 3
  4 3 5
  1 4 3
  2 4 4
  3 4 7
  4 4 6
  </code></pre>
  
  <p>How is this to solve.</p>