title: Adding a color key to contour plots in R
body: <p>I want to create a contour plot that has a color key next to it.</p>
  
  <p>I would make the contour plot like this:</p>
  
  <pre><code>data(volcano)
  image(volcano)
  contour(volcano, add = TRUE)
  </code></pre>
  
  <p>However, <code>image()</code> does not support a legend as far as I know. I saw that there is also a <code>contourplot()</code> function in the <code>lattice</code> package, however, I cannot figure it out how to overlay
  the map with the contour lines when using <code>levelplot(volcano)</code> and <code>contourplot(volcano)</code></p>
  
  <p>Ideally I want my plot to look like this but with a color key:</p>
  
  <p><img src="https://i.stack.imgur.com/C31CQ.png" alt="enter image description here"></p>