title: How to make a heatmap in R with xyz dissimilar data
body: <p>I am trying to use the <a href="https://stackoverflow.com/questions/8421536/a-true-heat-map-in-r">A true heat map in R</a> suggestions, however I get the error:</p>
  
  <blockquote>
    <p>Error in interp.old(x, y, z, xo = xo, yo = yo, ncp = 0, extrap = extrap,<br>
        : scales of x and y are too dissimilar</p>
  </blockquote>
  
  <p>after the code line:</p>
  
  <pre><code> s &lt;- interp(x,y,z)
  </code></pre>
  
  <p>My data was constructed expecting to get coloured heat-map like lines in a dark continuous background, and works in <code>GNUplot</code> using <code>set pm3d map</code> and <code>set hidden3d</code>. The data corresponds to a model of molecules production (<code>y</code>) in a given time (<code>x</code>) with the frequency of appearance denoted by <code>z</code>. It looks like this:</p>
  
  <pre><code>1.000000000000e+00  1e-8    0
  
  1.000000000000e+00  5e-8    0
  
  1.000000000000e+00  1e-7    5
  
  1.000000000000e+00  5e-7    0
  
  1.000000000000e+00  1e-6    0
  
  1.000000000000e+00  5e-6    0
  
  1.000000000000e+00  1e-5    0
  
  1.000000000000e+00  5e-5    0
  
  1.000000000000e+00  1e-4    0
  
  1.000000000000e+00  5e-4    0
  
  1.000000000000e+00  1e-3    0
  
  1.000000000000e+00  5e-3    0
  
  1.000000000000e+00  1e-2    0
  
  1.000000000000e+00  5e-2    0
  
  1.000000000000e+00  1e-1    0
  
  1.000000000000e+00  5e-1    0
  
  1.000000000000e+00  1e+1    0
  
  1.000000000000e+00  5e+1    0
  
  1.000000000000e+00  1e+2    0
  
  1.000000000000e+00  5e+2    0
  
  1.000000000000e+00  1e+3    0
  
  1.000000000000e+00  5e+3    0
  
  1.000000000000e+00  1e+4    0
  
  1.000000000000e+00  5e+4    0
  
  1.000000000000e+00  1e+5    0
  
  1.000000000000e+00  5e+5    0
  
  1.000000000000e+00  1e+6    0
  
  1.000000000000e+00  5e+6    0
  
  1.000000000000e+00  1e+7    0
  
  1.000000000000e+00  5e+7    0
  
  1.000000000000e+00  1e+8    0
  
  1.000000000000e+00  5e+8    0
  
  2.000000000000e+00  1e-8    0
  
  2.000000000000e+00  5e-8    0
  
  2.000000000000e+00  1e-7    0
  
  2.000000000000e+00  5e-7    5
  
  2.000000000000e+00  1e-6    0
  
  2.000000000000e+00  5e-6    0
  
  2.000000000000e+00  1e-5    0
  
  2.000000000000e+00  5e-5    0
  
  2.000000000000e+00  1e-4    0
  
  2.000000000000e+00  5e-4    0
  
  2.000000000000e+00  1e-3    0
  
  2.000000000000e+00  5e-3    0
  
  2.000000000000e+00  1e-2    0
  
  2.000000000000e+00  5e-2    0
  
  2.000000000000e+00  1e-1    0
  
  2.000000000000e+00  5e-1    0
  
  2.000000000000e+00  1e+1    0
  
  2.000000000000e+00  5e+1    0
  
  2.000000000000e+00  1e+2    0
  
  2.000000000000e+00  5e+2    0
  
  2.000000000000e+00  1e+3    0
  
  2.000000000000e+00  5e+3    0
  
  2.000000000000e+00  1e+4    0
  
  2.000000000000e+00  5e+4    0
  
  2.000000000000e+00  1e+5    0
  
  2.000000000000e+00  5e+5    0
  
  2.000000000000e+00  1e+6    0
  
  2.000000000000e+00  5e+6    0
  
  2.000000000000e+00  1e+7    0
  
  2.000000000000e+00  5e+7    0
  
  2.000000000000e+00  1e+8    0
  
  2.000000000000e+00  5e+8    0
  
  3.000000000000e+00  1e-8    0
  
  3.000000000000e+00  5e-8    0
  
  3.000000000000e+00  1e-7    0
  
  3.000000000000e+00  5e-7    0
  
  3.000000000000e+00  1e-6    5
  
  3.000000000000e+00  5e-6    0
  
  3.000000000000e+00  1e-5    0
  
  3.000000000000e+00  5e-5    0
  
  3.000000000000e+00  1e-4    0
  
  3.000000000000e+00  5e-4    0
  
  3.000000000000e+00  1e-3    0
  
  3.000000000000e+00  5e-3    0
  
  3.000000000000e+00  1e-2    0
  
  3.000000000000e+00  5e-2    0
  
  3.000000000000e+00  1e-1    0
  
  3.000000000000e+00  5e-1    0
  
  3.000000000000e+00  1e+1    0
  
  3.000000000000e+00  5e+1    0
  
  3.000000000000e+00  1e+2    0
  
  3.000000000000e+00  5e+2    0
  
  3.000000000000e+00  1e+3    0
  
  3.000000000000e+00  5e+3    0
  
  3.000000000000e+00  1e+4    0
  
  3.000000000000e+00  5e+4    0
  
  3.000000000000e+00  1e+5    0
  
  3.000000000000e+00  5e+5    0
  
  3.000000000000e+00  1e+6    0
  
  3.000000000000e+00  5e+6    0
  
  3.000000000000e+00  1e+7    0
  
  3.000000000000e+00  5e+7    0
  
  3.000000000000e+00  1e+8    0
  
  3.000000000000e+00  5e+8    0
  
  4.000000000000e+00  1e-8    0
  
  4.000000000000e+00  5e-8    0
  
  4.000000000000e+00  1e-7    0
  
  4.000000000000e+00  5e-7    0
  
  4.000000000000e+00  1e-6    0
  
  4.000000000000e+00  5e-6    5
  
  4.000000000000e+00  1e-5    0
  
  4.000000000000e+00  5e-5    0
  
  4.000000000000e+00  1e-4    0
  
  4.000000000000e+00  5e-4    0
  
  4.000000000000e+00  1e-3    0
  
  4.000000000000e+00  5e-3    0
  
  4.000000000000e+00  1e-2    0
  
  4.000000000000e+00  5e-2    0
  
  4.000000000000e+00  1e-1    0
  
  4.000000000000e+00  5e-1    0
  
  4.000000000000e+00  1e+1    0
  
  4.000000000000e+00  5e+1    0
  
  4.000000000000e+00  1e+2    0
  
  4.000000000000e+00  5e+2    0
  
  4.000000000000e+00  1e+3    0
  
  4.000000000000e+00  5e+3    0
  
  4.000000000000e+00  1e+4    0
  
  4.000000000000e+00  5e+4    0
  
  4.000000000000e+00  1e+5    0
  
  4.000000000000e+00  5e+5    0
  
  4.000000000000e+00  1e+6    0
  
  4.000000000000e+00  5e+6    0
  
  4.000000000000e+00  1e+7    0
  
  4.000000000000e+00  5e+7    0
  
  4.000000000000e+00  1e+8    0
  
  4.000000000000e+00  5e+8    0
  </code></pre>
  
  <p>The first suggestion gave me some ugly results similar the ones obtained at first in <a href="https://stackoverflow.com/questions/8421536/a-true-heat-map-in-r">A true heat map in R</a> which is a plot with some horizontal lines full of dots in different gray-scale tones. The second seems to crash. I got this message from it:</p>
  
  <pre><code>&gt;Traceback:
  1: .Fortran("idsfft", as.integer(1), as.integer(ncp), as.integer(n),     as.double(x),  as.double(y), as.double(z), as.integer(nx),     as.integer(ny), x = as.double(xo), y = as.double(yo), z = zo,     integer((31 + ncp) * n + nx * ny), double(5 * n), misso = as.logical(misso),     PACKAGE = "akima")
  2: interp.old(x, y, z, xo = xo, yo = yo, ncp = 0, extrap = extrap,     duplicate = duplicate, dupfun = dupfun)
  3: interp(x, y, z)
  
  Possible actions:
  1: abort (with core dump, if enabled)
  2: normal R exit
  3: exit R without saving workspace
  4: exit R saving workspace
  </code></pre>
  
  <p>I just included more data in case it is helpful.
  I am calling the columns from the data frame this way:</p>
  
  <blockquote>
    <p>coso &lt;- read.table("/home/libertad/mygraphs/two/two_1_90/coso.txt", header = FALSE,sep = "\t")</p>
  </blockquote>
  
  <pre><code>&gt;x &lt;-coso[[1]]
  
  &gt;y &lt;-coso[[2]]
  </code></pre>
  
  <p>This is one of my graphs in GNUplot, I expected to get nicer ones with R.</p>