title: how to use same color intervals for different spplots in R
body: <p>I have interpolated maps of temperature data of different days, such like: </p>
  
  <p><img src="https://i.stack.imgur.com/tvO4I.png" alt="2 interpolated maps(left: January, right: July"></p>
  
  <p>I want to show the maps of different days side by side, but would like to have the same color ramps and intervals in the legendary for both. 
  The maximum temperature value is: 29.8
  min: -13.4</p>
  
  <p>I did try to use the Answer from <a href="https://stackoverflow.com/questions/21101382/how-to-use-the-same-color-scale-for-points-in-different-maps-in-r/21103053#21103053">How to use the same color scale for points in different maps in R?</a> but I did get an error by doing so:</p>
  
  <pre><code>maxim &lt;- 30
  minim &lt;- -14
  cuts &lt;- 2*(-7:15)
  p1 &lt;- spplot(idw_ger, "var1.pred", main="IDW January, 10", cuts=cuts, col.regions=bpy.colors(30)) +
  latticeExtra::layer(sp.polygons(ger, fill = NA, col = 'blue')) +
  latticeExtra::layer(sp.points(tdata,
                              fill = NA, col = 'black'))
  </code></pre>
  
  <p><em>Error in seq.default(zrng<a href="https://i.stack.imgur.com/tvO4I.png" rel="nofollow noreferrer">1</a>, zrng[2], length.out = cuts + 2) : 
    length must be non-negative number
  In addition: Warning message:
  In seq.default(zrng<a href="https://i.stack.imgur.com/tvO4I.png" rel="nofollow noreferrer">1</a>, zrng[2], length.out = cuts + 2) :
    first element used of 'length.out' argument</em></p>
  
  <p>What am I doing wrong and how can I bring it to work? </p>