Displaying 20 results from an estimated 2000 matches similar to: "How do I add a rug to a 3d 'persp' plot?"
2005 May 06
1
persp( ) Question
I have successfully fitted the model
loess.fit1 <- loess(response ~ X*Y)
and plotted it in 3D using
X.grid <- seq(0,10,length=100)
Y.grid <- seq(0,1000,length=100)
pred.loess1 <- predict(loess.fit1,
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 =
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
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).
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
Hello list.
I very often need 3d scatterplots, and use scatterplot3D quite a lot.
I am trying to modify persp() to plot scatterplots, and make use of
the theta and phi arguments that persp() offers. I am having some
difficulty passing the correct arguments to persp().
Here is my function so far. Much of it is copied from the persp() manpage.
points3d <- function(x,y,z,
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
Hello list.
I very often need 3d scatterplots, and use scatterplot3D quite a lot.
I am trying to modify persp() to plot scatterplots, and make use of
the theta and phi arguments that persp() offers. I am having some
difficulty passing the correct arguments to persp().
Here is my function so far. Much of it is copied from the persp() manpage.
points3d <- function(x,y,z,
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
2010 Feb 22
3
Re : how to plot select points in preexisting persp plot
Hello,
I am trying to plot selected data points to a preexisting persp plot
that satisfies 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
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 :
2008 May 05
2
axis and tick widths decoupled (especially in rugs!)
Hi!
(a complete newby, but will not give up easily!)
I was wondering if there is any way to decouple the axis and tick mark
widths? As I understand they are both controlled by the lwd setting, and
cannot be controlled independently? For example I might want to create major
and minor ticks, which I now know how to do by superimposing two axes with
different at settings, but what if I also wanted
2007 Jul 17
2
multiple rugs on a single plot
Hi
I could only find some discussion on this wrt lattice graphics (which I'm
not using). Apologies if I'm missing something obvious.
I'd like to produce 3 rug plots under a kernel density plot for a
population. The population is subdivided into 3 subpopulations, which I'd
like the rug plots to highlight. Naturally, when I do 3 rug plots, they all
plot over each other.
2003 Jun 05
1
persp(), par() and axis()
Dear R experts,
On explanation of persp() parameters the last item is:
...: additional graphical parameters (see `par').
However, setting the `tcl' parameter has no any effect.
I guess that axes are added to persp() in somewhat freakish
way, and have nothing in common with axis() function.
I found the very useful trans3d() function in persp() help
page, and I'd like to use it
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
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
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
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
2010 Dec 15
1
Problems drawing a colored 'rug' in the Lattice 'densityplot'
Hi All,
I'm trying to add a 'rug' representation of my data to a plot created
with densityplot(). While I can do this in the simple case, I can't do
it properly when I include the "groups" argument. I have an example
below. I am running a reasonably new version of R.
print(sessionInfo())
R version 2.12.0 Patched (2010-11-07 r53537)
Platform: i686-pc-linux-gnu
2007 Sep 04
1
rug() colors
Hello,
I have a simple question on rug().
Currently there is only one color possible for the rug.
Is it possible to plot a the rug with different colors, for each rug item ?
Thx.
Bjoern
2001 Nov 29
1
rug(x) clip warning incorrect if par("xlog")==TRUE (PR#1188)
To wit:
> plot(1:2,1:2,log="x")
> rug(1:2) # should not warn
Warning message:
some values will be clipped in: rug(1:2)
> plot(1:2,1:2,log="x")
> rug(c(0,.1,.2)) # should warn, but does not
>
I believe this fixes the problem:
% diff -c /tmp/orig.rug.R /tmp/cberry.rug.R
*** /tmp/orig.rug.R Thu Nov 29 12:59:00 2001
--- /tmp/cberry.rug.R Thu Nov 29
2002 Apr 08
2
user coordinates and rug plots in lattice graphics
Dear R list members,
I'd like to produce rug plots at the bottom of panels in a trellis display
(using the lattice package), but par("usr") doesn't return user coordinates
for panels, and consequently rug fails, as the following example (suggested
to me by Georges Monette) illustrates:
> x <- rnorm(50)
> y <- rnorm(50)
> f <-