title: Custom color scale for filled.contour heatmap with base R
body: <p>I have this kind of color palette that I want to use      </p>
  
  <pre><code>palette &lt;- colorRampPalette(c("darkblue", "blue", "lightblue1",
                                  "green", "yellow", "red", "darkred"))
  </code></pre>
  
  <p>Illustration how my graphs look at the moment
  <a href="https://i.stack.imgur.com/RJ68N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RJ68N.png" alt="enter image description here"></a></p>
  
  <p>I have used <code>filled.contour()</code> to plot this graph with some modifications.</p>
  
  <p>Here's a part of the code that makes somewhat similar graph</p>
  
  <pre><code>load("workspace.RData")
  library(lubridate)
  
  breaks &lt;- "2 hours"
  palette &lt;- colorRampPalette(c("darkblue", "blue", "lightblue1",
                                "green", "yellow", "red", "darkred"))
  f &lt;- function(x) as.POSIXct(levels(cut(x, breaks)))
  
  filled.contour(x = data$Time,
                 y = log10(channels),
                 z = df,
                 color.palette = palette,
                 plot.axes = axis(1, at = f(data$Time),
                                  labels = format(f(data$Time), "%H:%M")))
  </code></pre>
  
  <p>by using <code>data</code>, <code>channels</code> and <code>df</code> from <a href="https://www.dropbox.com/sh/2kxzshea3k0nitr/AACnJmantk3LnlVpuQtQOPePa?dl=0" rel="nofollow noreferrer">my workspace</a> made with <code>save.image()</code>.</p>
  
  <p>Now the function is making the color legend on the right look like that by default. I would like to specify myself that dark blue corresponds to 0 and dark red corresponds to some user defined value for example 20 million.</p>
  
  <p>I want this because if I was to compare the graph of this data with graph of some other data, they would have exactly the same color legend.</p>
  
  <p>Tell me if I need to provide more information or anything.</p>
  
  <p>EDIT:</p>
  
  <p>Provided the data from my workspace as <a href="https://www.dropbox.com/sh/2kxzshea3k0nitr/AACnJmantk3LnlVpuQtQOPePa?dl=0" rel="nofollow noreferrer">workspace.RData</a> file.</p>