title: 3D Plot of normal distribution in R around a (x,y) point
body: <p>I want to plot a univariate normal density function of the normal distribution onto a (x,y,z) coordinate system. 
  The code I am using is:</p>
  
  <pre><code>library(rgl)
  open3d()
  
  x &lt;- seq(0, 10, length=100)
  y &lt;- seq(0, 10, length=100)
  
  
  z = outer(x,y, function(x,y) dnorm(x,2.5,1)*dnorm(y,2.5,1))
  
  persp3d(x, y, z,col = rainbow(100))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7Oxfl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Oxfl.png" alt="enter image description here"></a></p>
  
  <p>The problem I an encountering is that I want the normal distribution not to be around its mean only but also to be on a straight line or a circle. In latter case, I would expect the output to be similar to a volcano. I guess I must first create some probabilities within a loop. How can I do this? Or should I also use some surface command to plot the output? I am pretty sure this has nothing to do with a bivariate normal though.</p>
  
  <p>Best
  Fuji</p>