similar to: help with "persp" function

Displaying 20 results from an estimated 5000 matches similar to: "help with "persp" function"

2012 Jul 05
1
Adding Text to a persp plot using specific coordinates
Hi folks, I'm experiencing some hassle to add some text on a persp plot... Here is the code to generate the persp plot: x <- seq(-1.95, 1.95, length = 30) y <- seq(-1.95, 1.95, length = 30) z <- outer(x, y, function(a,b) a*b^2) persp(x, y, z,xlim=c(-2,2),ylim=c(-2,2),zlim=c(-8,8), phi=30, theta=-30,nticks=8,ticktype="detailed") I've tried the text() function :
2002 Mar 18
2
persp(): add second plane (second, long question)
Thank you for your replies so far. Sorry for bothering you again, but I'm still not able to get what I need as I don't understand all parts of the replies (just using R for easy things....). Is there a code for plane3d() like some of you sent me for points3d()? I was not able to get that out of the scatterplot3d package... What I can do is to get the x,y and z-range for the xlim,ylim and
2008 Mar 11
2
persp question
someone sent in a question earlier about doing something in 3D so i took a stab at it purely for educational purposes ( i'm not even sure that I understood the question actually ). Unfortunately, persp gives me an error that I don't understand because it says "object y not found". I'm sending y in as a parameter to persp similar to what ?persp shows in one of oits examples
2013 May 16
1
Contour lines in a persp plot
Hello folks, i'm a R beginner and i want to put in a same plot both contour lines and persp plot. For example, 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
2010 Feb 07
1
contour & persp
I have this data set that both x & y are ordered vectors of length 600 & 700 respectively; z is a 600 by 700 matrix whose entry z[i,j] is either a missing value (indicated by 'NaN') or a real number between 0 and 1. The contour function contour(x,y,z) gives me a blank picture. I guess the reason is that most of z-entries are missing, only less than 1% are non missing.
2005 May 30
1
persp, add lines/highlights
Hello R-sters, I'm trying to add several lines to a response surface that I've plotted using persp(). I've tried lines() using the "trans3d" function but I've been unsuccessful in getting it to work (R v2.0.1). Essentially, I'm trying to highlight one or more of the surface wireframe lines in a bolder (or different) color. Any tips from those of you who have some
2009 Mar 29
2
number of ticks in a persp() plot
Hi, I am trying to specify four ticks (at 0,1,2,3 for the y axis) in a persp plot but the defaults overrule my specification and I obtain seven of them. Is it possible to gain full control over them in such a plot? Here is my code: matlines=matrix(c(1:7,3:9,3:9,2:8),nrow=7,ncol=4)
2007 Sep 10
1
persp() problem
I am having some trouble getting the persp() package to change the x and y axis on a 3d plot. It defaults to the [0,1] interval and when I try to change it I get errors. Example: This works: ------------ D <- c(1,2,3,4,5,6,7,8,9,10) M <- c(11,12,13,14,15,16,17,18,19,20) DM <- cbind(D,M) persp(DM, theta = 40, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120,
2009 Nov 22
1
"Over-coloring" facets on persp() plot
Dear R Community: Recently, I have managed to plot some really useful graphs of my research data using persp(). I have even figured out how to overplot rectangular regions (corresponding to submatrices) with a different color. This is accomplished by using par(new=T). I am now searching for a way to "highlight" a set of (possibly non-contiguous) facets with a specific color,
2007 Apr 11
2
persp Error. x,y,z with the same length
Hello, I have a problem in drawing a 3d graphic. I simplified the program to show you the problem. I have a text file with hundreds of entries in 3 columns. I scaned these columns with matrix(scan). Then, I transformed some datas. Now I have the datas in h,x,y. I created a new matrix to use persp . But I got an error. The reason is probably the same length of x,y,z. But what can I do the draw
2010 Jul 30
2
Layering multiple persp plots
Hi all, I've got two persp plots with Identical X and Y's, and I'd like to plot them on the same graph, so that it is obvious where one plot is above the other. I can't find any mention of this anywhere. Do I need to use wireframe? Any help is appreciated. Thanks, -- Ian Bentley M.Sc. Candidate Queen's University Kingston, Ontario [[alternative HTML version deleted]]
2012 Apr 20
1
lines on persp plot - proper depth ordering
Hello R-help! I am trying to draw series of lines in 3d, and I am not sure how to get the depth set up properly - lines that are in front of other lines appear to be behind and vice versa. I've been doing this by first generating an empty persp plot, then adding lines via the data into trans3d followed by lines (this is probably a bad approach, but it was the first one I could get working).
2001 Aug 07
1
multiple persp plots
Hello, I would like to plot two superposed surfaces (original data, and smoothed models). Basically, I would like to create a usual persp plot with box, and then superpose a second surface (without box and axes) on the top plane of the box defined by the first graph. I don't know if it is clear :-( Is it possible to draw such a second surface in an existing persp plot in R? Another (related)
2005 Sep 19
1
distance to eye in persp()
Hi the manpage for persp() has a wonderful section where a the trans3d () function is used with points() and lines() to add red dots and a green sinusoid to the Mexican hat surface. Does anyone have a way to tell what distance a point is from the eye/ camera? Take the following line: lines (trans3d(x, y=10, z= 6 + sin(x), pm = res), col = 3) Is there a function like trans3d() that returns
2006 Jun 28
1
persp/ scatterplot3d
Dear WizaRds, I would like to create a 3d-plot with persp(). I sampled 17 points with xyz-coordinates (real-life example!), representing the peaks of the whole plane with "zero coordinates" x=3,y=3,z=3. My intention is to show which entries are above or below the "zero" level with persp() on a nicely created grid. I also tried scatterplot3d(), but, alas, I am unable
2003 Sep 08
2
Persp Plot
I am trying to graph two planes on the same graph using persp(). I can only get one plane to plot at a time. Can someone explain how I can graph two planes on the same graph using persp? I've looked throught the documentation, but cannot find any references to appending a persp plot. Thanks. Sincerely yours, Mark J. Lamias Statistical Consultant
2013 Oct 15
1
plotting a marginal distribution on the plane behind a persp() plot
R'istas: I am trying to plot a marginal distribution on the plane behind a persp() plot. My existing code is: library(MASS) X <- mvrnorm(1000,mu=c(0,0),Sigma=matrix(c(1,0,0,1),2)) X.kde <- kde2d(X[,1],X[,2],n=25) # X.kde is list: $x 1*n, $y 1*n, $z n*n persp(X.kde,phi=30,theta=60,xlab="x_b",ylab="x_a",zlab="f") ->res Any suggestions are very
2004 Dec 15
3
adding perspectives to existing persp plots
I've created a perspective plot using 'persp' in the graphics package. I'd like to add a second plane of z values to the existing plot, but I cannot seem to do this using 'persp'. Is there an analogue to 'lines' or 'points' for perspectives? Corey. corey.bradshaw at cdu.edu.au
2011 Dec 29
2
3d plotting alternatives. I like persp, but regret the lack of plotmath.
I have been making simple functions to display regressions in a new package called "rockchalk". For 3d illustrations, my functions use persp, and I've grown to like working with it. As an example of the kind of things I like to do, you might consult my lecture on multicollinearity, which is by far the most detailed illustration I've prepared.
2011 Aug 04
3
persp()
Hello I am trying to draw a basic black and white map of two European countries. After searching some key words in google and reading many pages I arrived to the conclusion that persp() could be used to draw that map. I have prepared three small example files, which are supposed to be the files required for running that function. xvector is a vector with the longitudes yvector is a vector with