title: Plotting multiple heat maps from a single data file
body: <p>I'm actually trying to make a density map but the key word seems to be heat map. Here is my issue. I have a data file which looks like this: (the formatting is weird but it's a 12x12 square matrix with each column separated by space)</p>
  
  <pre><code>#orbital            1
  #upspin density
  
  50  49  51  48  54  50  49  46  51  52  49  49
  49  52  55  52  53  52  48  51  53  49  50  54
  46  54  53  53  52  48  51  53  50  47  49  50
  50  51  50  51  47  49  51  55  48  49  48  50
  51  53  49  49  49  54  49  49  53  52  51  50
  49  51  51  49  55  54  49  51  49  52  50  51
  49  46  51  52  49  49  50  49  51  48  54  50
  48  51  53  49  50  54  49  52  55  52  53  52
  51  53  50  47  49  50  46  54  53  53  52  48
  51  55  48  49  48  50  50  51  50  51  47  49
  49  49  53  52  51  50  51  53  49  49  49  54
  49  51  49  52  50  51  49  51  51  49  55  54
  #downspin density
  
  
  50  49  51  48  54  50  49  46  51  52  49  49
  49  52  55  52  53  52  48  51  53  49  50  54
  46  54  53  53  52  48  51  53  50  47  49  50
  50  51  50  51  47  49  51  55  48  49  48  50
  51  53  49  49  49  54  49  49  53  52  51  50
  49  51  51  49  55  54  49  51  49  52  50  51
  49  46  51  52  49  49  50  49  51  48  54  50
  48  51  53  49  50  54  49  52  55  52  53  52
  51  53  50  47  49  50  46  54  53  53  52  48
  51  55  48  49  48  50  50  51  50  51  47  49
  49  49  53  52  51  50  51  53  49  49  49  54
  49  51  49  52  50  51  49  51  51  49  55  54
  #upspin + downspin 
  
  
  100  98 102  96 107  99  97  91 102 103  97  97
  98 103 110 103 105 104  96 101 106  97  99 107
  91 108 106 106 103  95 101 105 100  93  97 100
  100 101  99 101  93  98 102 109  96  98  95  99
  101 105  97  97  98 108  98  98 106 103 102  99
  97 102 101  98 109 108  97 102  97 103 100 101
  97  91 102 103  97  97 100  98 102  96 107  99
  96 101 106  97  99 107  98 103 110 103 105 104
  101 105 100  93  97 100  91 108 106 106 103  95
  102 109  96  98  95  99 100 101  99 101  93  98
  98  98 106 103 102  99 101 105  97  97  98 108
  97 102  97 103 100 101  97 102 101  98 109 108
  #upspin - downspin
  
  
  0   0   1   1   0   0   0   0   0   1   1   0
  0   0   1   1   0   1   1   0   0   1   0   0
  1   1   1   0   1   0   1   1   0   0   0   0
  0   0   1   1   1   1   1   1   0   1   0   0
  1   1   0   1   0   1   1   1   1   0   1   1
  1   0   1   1   1   0   1   0   1   0   1   0
  0   1   1   0   1   0   0   1   0   1   0   0
  1   1   0   1   1   1   1   0   1   1   1   1
  0   1   1   1   1   0   0   0   0   0   0   0
  1   1   0   1   1   1   0   1   0   1   1   0
  1   0   0   1   1   0   0   0   1   1   1   1
  1   0   0   0   1   0   1   0   0   0   0   1
  #atom            1
  #total upspin density                       downspin density
  
  
  50  49  51  48  54  50  49  46  51  52  49  49
  49  52  55  52  53  52  48  51  53  49  50  54
  46  54  53  53  52  48  51  53  50  47  49  50
  50  51  50  51  47  49  51  55  48  49  48  50
  51  53  49  49  49  54  49  49  53  52  51  50 
  49  51  51  49  55  54  49  51  49  52  50  51
  49  46  51  52  49  49  50  49  51  48  54  50
  48  51  53  49  50  54  49  52  55  52  53  52
  51  53  50  47  49  50  46  54  53  53  52  48
  51  55  48  49  48  50  50  51  50  51  47  49
  49  49  53  52  51  50  51  53  49  49  49  54
  49  51  49  52  50  51  49  51  51  49  55  54
  #total downspin density
  
  
  50  49  51  48  54  50  49  46  51  52  49  49  
  49  52  55  52  53  52  48  51  53  49  50  54
  46  54  53  53  52  48  51  53  50  47  49  50
  50  51  50  51  47  49  51  55  48  49  48  50
  51  53  49  49  49  54  49  49  53  52  51  50
  49  51  51  49  55  54  49  51  49  52  50  51
  49  46  51  52  49  49  50  49  51  48  54  50
  48  51  53  49  50  54  49  52  55  52  53  52
  51  53  50  47  49  50  46  54  53  53  52  48
  51  55  48  49  48  50  50  51  50  51  47  49
  49  49  53  52  51  50  51  53  49  49  49  54
  49  51  49  52  50  51  49  51  51  49  55  54
  </code></pre>
  
  <p>I am trying to write a script that takes these matrices and make an individual "heat map" for each. My issue is that when I run the script I'm getting an error that says the data doesn't represent a grid.My script is below. An additional question is what are the acceptable formats for gnuplot to read a matrix?</p>
  
  <pre><code>set size ratio 1
  set cbrange [0:0.5]
  set palette defined (0 "red", 1 "blue")
  set autoscale xfix
  set autoscale yfix
  set xtics 1
  set ytics 1
  set title "8x8 spin"
  set tics scale 0,0.001
  set mxtics 2
  set mytics 2
  set grid front mxtics mytics lw 1.5 lt -1 lc rgb 'white'
  plot "densityarrays.d" matrix w image notitle
  set term png enhanced
  set output "/home/thecollective/Desktop/plots/plot1.png"
  replot
  </code></pre>