title: How to add ellipse plane to 3D plot in R
body: <p>R code about plot plane z = x+y：</p>
  
  <pre><code>library("rgl")
  f &lt;- function(x,y) 
  x+y
  
  x_grid &lt;- seq(0,1, length=20)
  y_grid &lt;- x_grid 
  z_grid &lt;- outer(x_grid, y_grid, f)
  surface3d(x_grid, y_grid, z_grid,front="line",back="line")
  axes3d() 
  </code></pre>
  
  <p>R code about plot ellipse 5x^2-4xy+5y^2=1：</p>
  
  <pre><code>my.fun &lt;- function(x,y){5*x^2 - 4*x*y + 5*y^2}
  x&lt;-seq(-sqrt(5/21), sqrt(5/21), length.out = 101)
  y&lt;-seq(-sqrt(5/21), sqrt(5/21), length.out = 101)
  z&lt;-outer(x,y,my.fun)
  contour(x, y, z, levels = 1, drawlabels = 0, xlab = "x", ylab = "y")
  </code></pre>
  
  <p>How to add ellipse plane to 3D plot in R? Thanks!</p>