title: R plot background map from Geotiff with ggplot2
body: <p>With the R base plot, I can plot any geotiff with the following command:</p>
  
  <pre><code>library("raster")
  plot(raster("geo.tiff"))
  </code></pre>
  
  <p>For example, downloading <a href="http://www.swisstopo.admin.ch/internet/swisstopo/de/home/products/maps/national/digital/national.parsys.70980.downloadList.12438.DownloadFile.tmp/smr25musterdaten.zip" rel="noreferrer">this</a> data, I would do the follwing:</p>
  
  <pre><code>setwd("C:/download") # same folder as the ZIP-File
  map &lt;- raster("smr25musterdaten/SMR_25/SMR_25KOMB_508dpi_LZW/SMR25_LV03_KOMB_Mosaic.tif")
  </code></pre>
  
  <p><em>How do you Plot GeoTif Files in ggplot2?</em></p>
  
  <p>EDIT:</p>
  
  <p>1: I've replaced the greyscale map from the sample files with a coloured map to ilustrate the problem of the missing colortable.</p>
  
  <p>2: With the help of Pascals answer, I was able to adapt and improve <a href="https://stackoverflow.com/questions/19196923/r-original-colours-of-georeferenced-raster-image-using-ggplot2-and-raster-pac">this solution</a> and make it more dynamic to the input tif. I will post the answer below.</p>