title: Creating continuous heat map that looks like IDW interpolation
body: <p>I am trying to plot heat map in R with ggplot2 but the interpolated plot is too much smoothed. </p>
  
  <p><a href="https://www.dropbox.com/s/fsnfvgku9dn39k8/heatmap.xlsx?dl=0" rel="nofollow noreferrer">link for the data</a></p>
  
  <p>my current code is:</p>
  
  <pre><code>library(ggplot2)
  library(xlsx)
  setwd("G:\\ggplot_tables")
  df = read.xlsx("heatmap.xlsx",sheetName = "Sheet1",as.data.frame=TRUE)
  v = ggplot(df,aes(Zone,Year,z=Value))
  v+geom_raster(aes(fill = Value),interpolate = T)+scale_fill_gradientn(colours = terrain.colors(10))                                     
  </code></pre>
  
  <p>The resulted output is too much smoothed as shown below.
  <a href="https://i.stack.imgur.com/YcLkV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YcLkV.png" alt="enter image description here"></a></p>
  
  <p>I want to achieve results as shown below</p>
  
  <p><a href="https://i.stack.imgur.com/cIqvV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cIqvV.png" alt="enter image description here"></a></p>
  
  <p>It appears from the plot that IDW interpolation is used to prepare the plot.
  I have also tried IDW interpolation in R with equally spaced point shapefile</p>
  
  <p>My code and output is shown below</p>
  
  <p><a href="https://www.dropbox.com/s/nchmhgl11j70ix8/Heatmap.rar?dl=0" rel="nofollow noreferrer">link for the shape file</a></p>
  
  <pre><code>library(rgdal)
  library(gstat)
  data.shape = readOGR(dsn = getwd(), layer = "heatmap")
  grd&lt;- as.data.frame(spsample(data.shape, "regular", n=10500))
  names(grd)       &lt;- c("X", "Y")
  coordinates(grd) &lt;- c("X", "Y")
  gridded(grd)     &lt;- TRUE
  fullgrid(grd)    &lt;- TRUE
  proj4string(grd) &lt;- proj4string(data.shape)
  P.idw &lt;- gstat::idw(Value ~ 1, data.shape, newdata=grd, idp=2.0)
  plot(P.idw, zlim = c(90,170))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TCO0e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TCO0e.png" alt="enter image description here"></a></p>
  
  <p>IDW result is close to what I am trying to achieve.But the problem is that I am not able to change the values of <code>X-axis to zone</code> and <code>Y- axis to Year</code>.</p>
  
  <p>Any help to achieve the result as shown above will be appreciated.</p>