title: Matplotlib pcolor
body: <p>I am using Matplotlib to create an image based on some data. All of the data falls in the range of 0 through to 1 and I am trying to color the data based on its value using a colormap and this works perfectly in Matlab, however when converting the code across to Python I simply get a black square as the output. I believe this is because I'm plotting the image wrong and so it is plotting all the data as 0. I have tried searching this problem for several hours and I have tried <code>plt.set_clim([0, 1])</code> however that didn't seem to do anything. I am new to Python and Matplotlib, although I am not new to programming (Java, javascript, PHP, etc), but I cannot see where I am going wrong. If any body can see anything glaringly incorrect in my code then I would be extremely grateful.</p>
  
  <p>Thank you</p>
  
  <pre><code>from numpy import *
  import matplotlib
  import matplotlib.pyplot as plt
  import matplotlib.colors as myColor
  
  e1cx=[]
  e1cy=[]
  e1cz=[]
  print("Reading files...")
  in_file = open("eigenvector_1_component_x.txt", "rt")
  for line in in_file.readlines():
  e1cx.append([])
  for i in line.split():
      e1cx[-1].append(float(i))
  in_file.close()
  in_file = open("eigenvector_1_component_y.txt", "rt")
  for line in in_file.readlines():
  e1cy.append([])
  for i in line.split():
      e1cy[-1].append(float(i))
  in_file.close()
  in_file = open("eigenvector_1_component_z.txt", "rt")
  for line in in_file.readlines():
  e1cz.append([])
  for i in line.split():
      e1cz[-1].append(float(i))
  in_file.close()
  print("...done")
  
  nx = 120
  ny = 128
  nz = 190
  
  
  fx = zeros((nz,nx,ny))
  fy = zeros((nz,nx,ny))
  fz = zeros((nz,nx,ny))
  
  z = 0
  while z&lt;nz-1:
  x = 0
  while x&lt;nx:
      y = 0
      while y&lt;ny:
          fx[z][x][y]=e1cx[(z*128)+y][x]
          fy[z][x][y]=e1cy[(z*128)+y][x]
          fz[z][x][y]=e1cz[(z*128)+y][x]
          y += 1
      x += 1
  z+=1
  if((z % 10) == 0):      
      plt.figure(num=None)
      plt.axis("off")
      normals = myColor.Normalize(vmin=0,vmax=1)
      plt.pcolor(fx[z][:][:],cmap='spectral', norm=normals)   
      filename = 'Imagex_%d' % z
      plt.savefig(filename)
      plt.colorbar(ticks=[0,2,4,6], format='%0.2f')
  </code></pre>