Hello folks, I am a beginner R user. I have been able to make a 3D surface plot using 'persp'. The surface is made by a grid of lines emanating perpendicularly from each of the x and y axes at regular intervals.
I can get rid of that grid by setting 'border=NA'. Can anyone suggest some ways to replace the grid with contour lines, to create a 3-dimensional contour map? Thanks for any help. Here is an example of what I have so far: #to create a perspective plot; plots funct. across all combos of x and y fn<-function(x,y){sin(x)+2*y} #this looks like a corrugated tin roof x<-seq(from=1,to=100,by=1) #generates a list of x values to sample y<-seq(from=1,to=100,by=1) #generates a list of y values to sample z<-outer(x,y,FUN=fn) #applies the funct. across the combos of x and y persp(z,col='lightgray',shade=.5,border=NA,) #plots without gridlines ______________________________________________ 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.