title: Colorbar from custom colorRampPalette
body: <p>I have defined a colorRampPalette:</p>
  
  <pre><code>my.colors = colorRampPalette(c("light green", "yellow", "orange", "red"))
  </code></pre>
  
  <p>How can I plot a colorbar "legend" item for it, preferably using only the base packages? I am after a rectangle filled with that color gradient.</p>
  
  <p>What I am really after is a way to produce the same type of legend (color bar) that is plotted with a "raster" raster:</p>
  
  <pre><code>require(raster)
  plot(raster("myfile.tif"), legend=T)
  </code></pre>
  
  <p>I need to be able to place this on top of another plot.</p>