search for: trans3d

Displaying 20 results from an estimated 51 matches for "trans3d".

2009 Mar 14
4
persp plot + plotting grid lines
Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: http://thermal.gg.utah.edu/tutorials/matlab/matlab_tutorial.html I'll appreciate any ideas Thanks PM
2005 May 06
1
persp( ) Question
...t1, expand.grid(x = X.grid, y = Y.grid)) persp(X.grid, Y.grid, pred.loess1, theta = 0, phi = 12) I would like to add a series of points along the fitted surface at X.grid = 2, in red. The example in the online help uses f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } phi <- seq(0, 2*pi, len = 201) r1 <- 7.725 # radius of 2nd maximum xr <- r1 * cos(phi) yr <- r1 * sin(phi) lines(trans3d(xr,yr, f(xr,yr), res), col = "pink",...
2006 Mar 11
2
Draw level lines on the surface of a bivariate function
Hello, Is it possible to draw level lines on the surface of a bivariate function? In the following example, to draw surface and levels lines for a multivariate normal law, I use persp, trans3d, contourLines and lines, but if the lines are correctly drawn, some parts of them are, of course, visible even if they are drawn on a non visible "face". Any suggestion to avoid this problem ? Thank you Etienne Example : trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,...
2009 Mar 30
1
How do I add a rug to a 3d 'persp' plot?
...and Y axes (corresponding to my independent variables) in order to get a sense for how many data points I'm working with to graph various portions of the surfaces. The trouble is, I can't just plot the rugs with rug() because it's a 3-d plot. Similarly, I can't just pass rug() into trans3d() because trans3d() requires a set of three coordinates, right? And rug() internally calls on Axis(), which doesn't correspond to anything that references points. I'm thinking I'll have to draw the rugs manually by figuring out what set of lines() commands would do the same thing to a...
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 functio...
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). Here is a semi-contrived minimal example of my problem: ########################################################### #line 1 x1=0:10; y1=rep(0,11); z1 = rep(5,11); #line 2 x2=y2=z2 = 0:10 # make em...
2002 Mar 14
1
persp(): add second plane
Dear R-users, is it possible to add a second plane to the persp()-plot? I couldn't find any hint on that in the news archive... I'm using R.1.4.1 for Windows. Thanks in advance, Nina -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2002 Mar 14
1
persp(): add second plane
Dear R-users, is it possible to add a second plane to the persp()-plot? I couldn't find any hint on that in the news archive... I'm using R.1.4.1 for Windows. Thanks in advance, Nina -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2004 Nov 19
4
3d Map with bars
Apologies in advance for the question. I am trying to draw a map of the US as a surface plot so that I would be able to drop bars on the different states (something like Uwe Ligges' scatterplot3d example 4). I am not sure where to start looking for such a beast. If anyone has any pointers, ideas, I will be grateful. TIA, Partha
2004 Dec 02
1
Arrow and text on a 3d plot
I am currently working on surface plots (with R 2.0.1) and I want to improve the aspect of them. Having a typical 'cow-boy hat' surface [source: Spector (1994), p. 206]: pts <- seq(from = -8, to = 8, length = 50) cow <- function(x, y) { z <- sqrt(x^2+y^2) sin(z)/z } out <- outer(pts, pts, cow) sur <- persp(x=pts, y=pts, z=out, theta=45, phi=30) What I exactly wanted is:
2004 Aug 26
1
Adding 3D points
I would like to add individual points and lines to a persp() plot that I generated with the geoR package. It is a kriged surface map of a field plot and I'd like to overlay my sampling points on it but am having some trouble. I loaded the scatterplot3d package, but I can't seem to use the add parameter with it. Any suggestions?
2010 Feb 22
3
Re : how to plot select points in preexisting persp plot
...a condition. I used the following statement - text(coords[,1], coords[,2], names(act[which(act > 8.75)]), cex=0.7) But I get all the points labeled, instead of the points that satisfy the condition specified. Is there any way to plot only the points I want? Also can this be done using "trans3d" function. I found no topics pertaining to this issue. Regards, Preeti
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
...m the persp() manpage. points3d <- function(x,y,z, jj.colour="black", ...){ if(is.matrix(x)){ z <- x[,3] y <- x[,2] x <- x[,1] } z.grid <- matrix(range(z),2,2) persp(range(x), range(y), z.grid, col = NA,border=NA, ...) -> res trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } points(trans3d(x,y,z,pm=res), col=jj.colour, ...) } With this, things like O <- matrix(rnorm(60),20,3) points3d(O,jj.colour="red",pch=16,thet...
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
...m the persp() manpage. points3d <- function(x,y,z, jj.colour="black", ...){ if(is.matrix(x)){ z <- x[,3] y <- x[,2] x <- x[,1] } z.grid <- matrix(range(z),2,2) persp(range(x), range(y), z.grid, col = NA,border=NA, ...) -> res trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } points(trans3d(x,y,z,pm=res), col=jj.colour, ...) } With this, things like O <- matrix(rnorm(60),20,3) points3d(O,jj.colour="red",pch=16,thet...
2012 Jul 05
1
Adding Text to a persp plot using specific coordinates
...library could add text on a plot3d object or a persp object. But when I try this: text3d(x=0,y=0,z=1,texts="O") The result is that R opens a new window with the string "O" printed in the new window. And no text is added to my previous persp plot. I've seen that maybe using trans3d would help but after many tries, I gave up. This function did not allow me to plot text with the specified coordinates. Any ideas on how adding some text or labels to an existing persp plot using the coordinates I've entered? Thanking you in anticipation. Dubreuil Benjamin Research Assistant...
2003 Dec 25
6
Plot a sphere
Hi, I'm new to R (and math ;) Would somebody please be so kind as to direct me in plotting a 3D sphere? I tried something in the lines of: #### y <- x <- seq(-pi, pi, length=pi*10) f <- function(x,y) { z <- sqrt(pi - x^2 - y^2) #z[is.na(z)] <- 0 z } z <- outer(x, y, f) persp(x, y, z, theta = 120, phi = 30) #### I've also tried: .... make.surface.grid(...) ..
2002 Aug 01
4
What does persp() return?
I want to plot some 3D points on top of the grid produced by persp(). On 2/22/01, Paul Murrell <paul at stat.auckland.ac.nz> wrote in R-help: > In S-Plus, persp() returns a value that can be used to transform 3D > locations to 2D, but this sort of thing is not (yet) available in R. But persp() does return something (in R-1.5.1): a 4x4 matrix which in the C code is called the
2011 Feb 09
1
Plot bivariate density with densities margins
Dear R users, I would like to plot the bivariate density surface with its marginal densities on the sides of the 3D box, just like in the picture I attach. I tried to found information about how to do it but did not find anything. Does anyone know how to do it? Thanks in advance, Eduardo.
2004 Nov 18
0
Fwd: Re: 3d scatter plot with drop line
...x1 <- x1[,1] } if(missing(zlim)) { z.grid <- matrix(range(z),2,2) } else { z.grid <- matrix(zlim,2,2) } if(missing(xlim)){ xlim <- range(x) } if(missing(ylim)){ ylim <- range(y) } persp(xlim, ylim, z.grid, col = NA, border=NA, ...) -> res trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } out <- trans3d(x,y,z,pm=res) out1 <- trans3d(x1,y1,z1,pm=res) points(out, col=col, pch=pch, cex=cex, ...) for(i in 1:length(out$x)){ lines(c(out$x[i],out1...
2002 Oct 21
2
3-D scatter plot laid over Surface plot
Hello, I have created a Fitness surface (persp()), with data that was created by a tp spline procedure. Now I would like to superimpose a set (XYZ) of existing points (from two different treatments) onto this surface. I didn't come across any function or command that is able to do this in R. Could somebody please help me in finding a solution to this problem Thank you Peter --