title: Plot 4D data as layered heatmaps in Python
body: <p>I would like to create layered heatmaps using (x,y,z) coordinates and a fourth dimension, color-based, to correlate to intensity. </p>
  
  <p>Each layer-related data sits in a text file with columns of x, y, z and G. The delimiter is white space. Apologies if it does not present properly.</p>
  
  <p>XA
  200
  600
  1200
  1800
  2400
  3000
  200
  600
  1200
  1800
  2400
  3000</p>
  
  <p>YA
  0
  0
  0
  0
  0
  0
  600
  600
  600
  600
  600
  600</p>
  
  <p>ZA
  600
  600
  600
  600
  600
  600
  600
  600
  600
  600
  600
  600</p>
  
  <p>GA
  1.27
  1.54
  1.49
  1.34
  1.27
  1.25
  1.28
  1.96
  1.12
  1.06
  1.06
  1.06</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  
  data = np.load(filename)
  
  x = np.linspace(0,2400,num=6)
  y = np.linspace(0,2400,num=11)
  X,Y=np.meshgrid(x,y)
  Z = data[:,:,0] * 1e-3
  
  plt.contourf(X,Y,Z)
  plt.colorbar()
  </code></pre>
  
  <p><em>How to read text files, create and superimpose heatmaps along the Z-axis?</em></p>