I have drawn a 3D scatter plot : library(mnormt) library(scatterplot3d) dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) scatterplot3d(dat) Now I want to do 2 things : 1 : In the Z-axis (i.e. height), I want to see only numbers 1,2,3, etc NOT, 1,1.5,2,2.5............. 2. I want to add two Horizontal planes at hight z=2 and z=3. Those two planes should look like "bottom" of that 3D plot [i.e. like Grid-lines].I already gone through "$plane3d" but could not get through. In the help page, a description is given with a regression line, however I could not understand how I can implement that in my problem. Any help will be highly appreciate. Regards,
Megh Dal wrote:> I have drawn a 3D scatter plot : > > library(mnormt) > library(scatterplot3d) > dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) > scatterplot3d(dat) > > Now I want to do 2 things : > > 1 : In the Z-axis (i.e. height), I want to see only numbers 1,2,3, etc NOT, 1,1.5,2,2.5............. > > 2. I want to add two Horizontal planes at hight z=2 and z=3. Those two planes should look like "bottom" of that 3D plot [i.e. like Grid-lines].I already gone through "$plane3d" but could not get through. In the help page, a description is given with a regression line, however I could not understand how I can implement that in my problem.Example: s3d <- scatterplot3d(dat, lab.z=2, scale.y=0.7, angle=20) s3d$plane3d(2,0,0, "solid", col="grey") Uwe Ligges> Any help will be highly appreciate. > > Regards, > > ______________________________________________ > R-help at 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.
I got following error :> library(mnormt) > library(scatterplot3d) > dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) > s3d <- scatterplot3d(dat, lab.z=2, scale.y=0.7, angle=20) > s3d$plane3d(2,0,0, "solid", col="grey")Error in object$coefficients : $ operator is invalid for atomic vectors I am using following version:> R.Version()$platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw32" $status [1] "" $major [1] "2" $minor [1] "7.1" $year [1] "2008" $month [1] "06" $day [1] "23" $`svn rev` [1] "45970" $language [1] "R" $version.string [1] "R version 2.7.1 (2008-06-23)" --- On Thu, 10/2/08, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote:> From: Uwe Ligges <ligges at statistik.tu-dortmund.de> > Subject: Re: [R] Adding plane in a 3D scatterplot > To: megh700004 at yahoo.com > Cc: r-help at stat.math.ethz.ch > Date: Thursday, October 2, 2008, 11:38 PM > Megh Dal wrote: > > I have drawn a 3D scatter plot : > > > > library(mnormt) > > library(scatterplot3d) > > dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) > > scatterplot3d(dat) > > > > Now I want to do 2 things : > > > > 1 : In the Z-axis (i.e. height), I want to see only > numbers 1,2,3, etc NOT, 1,1.5,2,2.5............. > > > > 2. I want to add two Horizontal planes at hight z=2 > and z=3. Those two planes should look like > "bottom" of that 3D plot [i.e. like Grid-lines].I > already gone through "$plane3d" but could not get > through. In the help page, a description is given with a > regression line, however I could not understand how I can > implement that in my problem. > > Example: > > s3d <- scatterplot3d(dat, lab.z=2, scale.y=0.7, > angle=20) > s3d$plane3d(2,0,0, "solid", > col="grey") > > Uwe Ligges > > > > Any help will be highly appreciate. > > > > Regards, > > > > ______________________________________________ > > R-help at 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.
Please use a recent version of R *and* scatterplot3d. Uwe Ligges Megh Dal wrote:> I got following error : >> library(mnormt) >> library(scatterplot3d) >> dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) >> s3d <- scatterplot3d(dat, lab.z=2, scale.y=0.7, angle=20) >> s3d$plane3d(2,0,0, "solid", col="grey") > Error in object$coefficients : $ operator is invalid for atomic vectors > > I am using following version: >> R.Version() > $platform > [1] "i386-pc-mingw32" > > $arch > [1] "i386" > > $os > [1] "mingw32" > > $system > [1] "i386, mingw32" > > $status > [1] "" > > $major > [1] "2" > > $minor > [1] "7.1" > > $year > [1] "2008" > > $month > [1] "06" > > $day > [1] "23" > > $`svn rev` > [1] "45970" > > $language > [1] "R" > > $version.string > [1] "R version 2.7.1 (2008-06-23)" > > > > --- On Thu, 10/2/08, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote: > >> From: Uwe Ligges <ligges at statistik.tu-dortmund.de> >> Subject: Re: [R] Adding plane in a 3D scatterplot >> To: megh700004 at yahoo.com >> Cc: r-help at stat.math.ethz.ch >> Date: Thursday, October 2, 2008, 11:38 PM >> Megh Dal wrote: >>> I have drawn a 3D scatter plot : >>> >>> library(mnormt) >>> library(scatterplot3d) >>> dat = cbind(rmnorm(3, rep(0,2), diag(2)), 1:3) >>> scatterplot3d(dat) >>> >>> Now I want to do 2 things : >>> >>> 1 : In the Z-axis (i.e. height), I want to see only >> numbers 1,2,3, etc NOT, 1,1.5,2,2.5............. >>> 2. I want to add two Horizontal planes at hight z=2 >> and z=3. Those two planes should look like >> "bottom" of that 3D plot [i.e. like Grid-lines].I >> already gone through "$plane3d" but could not get >> through. In the help page, a description is given with a >> regression line, however I could not understand how I can >> implement that in my problem. >> >> Example: >> >> s3d <- scatterplot3d(dat, lab.z=2, scale.y=0.7, >> angle=20) >> s3d$plane3d(2,0,0, "solid", >> col="grey") >> >> Uwe Ligges >> >> >>> Any help will be highly appreciate. >>> >>> Regards, >>> >>> ______________________________________________ >>> R-help at 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. > > ______________________________________________ > R-help at 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.