title: How to fix 'continuous value supplied to discrete scale' in with scale_color_brewer
body: <p>I am attempting to make a map of global data anomaly (precip, temp etc) and need to use a diverging color palette. I have code that runs well with <code>scale_color_viridis</code> but it does not easily convert with <code>scale_color_brewer</code>. I would like to use the <code>RdBu</code> diverging palette.</p>
  
  <p>I have tried supplying the values <code>vars</code> within the function <code>scale_color_brewer</code> and using <code>scale_fill</code> brewer but I would like to continue plotting using the <code>geom_points</code> I have so far.</p>
  
  <pre><code>  titletext &lt;- paste(VAR, "Response")
    expand.grid(lon, lat) %&gt;%
      rename(lon = Var1, lat = Var2) %&gt;%
      mutate(lon = ifelse(lon &gt; 180, -(360 - lon), lon),
             vars = as.vector(global.array)) %&gt;% 
      ggplot() + 
      geom_point(aes(x = lon, y = lat, color = vars),
                 size = 2.0) + 
      borders("world", colour="black", fill=NA) + 
      scale_color_brewer(type="div", palette="RdBu")+
      #scale_color_viridis(na.value="white",name = VAR) +  
      theme(legend.direction="vertical", legend.position="right", 
            legend.key.width=unit(0.4,"cm"), legend.key.heigh=unit(2,"cm")) + 
      coord_quickmap() + ggtitle(titletext) 
  </code></pre>
  
  <p>Error message is </p>
  
  <blockquote>
    <p>Error: Continuous value supplied to discrete scale</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Warning messages:
    1: In RColorBrewer::brewer.pal(n, pal) :
      n too large, allowed maximum for palette RdBu is 11
    Returning the palette you asked for with that many colors</p>
  </blockquote>