title: Setting color range in persp3d() in R with plot3D
body: <p>I'm really new to R and I want to create an Image like the one I added here, but I need to have the Color Range from 0 to 1, right now it's set automatically, in the image it is from 0.2 to 0.6.</p>
  <p>Here is my R code that I use. Mat.csv is a 2D Matrix with values  in [0,1].</p>
  <pre><code>library(plot3D)
  mydata &lt;- read.csv(&quot;D:/output/Mat.csv&quot;)
  mydata &lt;- as.matrix(mydata)
  pdf(&quot;D:/output/surfaceplot.pdf&quot;)
  mycols &lt;- colorRampPalette( c(&quot;#ff0000&quot;, &quot;#00ff00&quot;) ) 
  persp3D(z = mydata, theta = 120, zlim=c(0,1))
  dev.off()
  </code></pre>
  <p>Example graph:
  <img src="https://i.stack.imgur.com/7jOke.png" alt="Example Graph" /></p>