Greetings,

I would like to plot a curve (in color red) on a surface in a 3D plot.
Say

    x <- as.vector(seq(-1,1,0.2))
    dim(x) <- c(length(x),1)
    y <- as.vector(seq(-1,1,0.2))
    dim(y) <- c(1,length(y))
    
    z <- x%*%y         # (x_iy_j)

    # 3D plot of z(x,y)=xy:
    persp(x,y,z)
 
Now I would like to plot the curve z=z(x,x) in red on this surface.
How do I do that?
 
Many thanks,
 
Michael Meyer

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to