|
Hi all! I’m using scatterplot3d() to show the distribution of data for different locations. As I wound like to show distances between the locations and also label the locations, I was wondering whether there is a function similar to axis() for a 2D plot that works with scatterplot3d()? 2D: a <- runif(50) a2 <- qnorm(a) b <- runif(50) b2 <- qnorm(b) c <- runif(50) c2 <- qnorm(c) data <- rbind(cbind(rep(1,50),a,a2),cbind(rep(7,50),b,b2),cbind(rep(10,50),c,c2)) plot(data[,1],data[,2],xaxt="n",xlab="Location",ylab="var 1") axis(1, at= c(1,7,10),labels = c("Loc 1","Loc 2", "Loc 3")) 3D: library(scatterplot3d) scatterplot3d(data[,1], data[,2], data[,3],box=T, col.axis="black", angle= 45,grid=T, xlab="Location",zlab="var 2",ylab="var 1") Thank you for your suggestions, Tonja Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android. [1]https://produkte.web.de/freemail_mobile_startseite/ References 1. https://produkte.web.de/freemail_mobile_startseite/ ______________________________________________ [hidden email] 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. |
|
On 13.04.2012 09:52, Tonja Krueger wrote: > > Hi all! > I’m using scatterplot3d() to show the distribution of data for different > locations. As I wound like to show distances between the locations and also > label the locations, I was wondering whether there is a function similar to > axis() for a 2D plot that works with scatterplot3d()? Not really, but you can try: library(scatterplot3d) scatterplot3d(data[,1], data[,2], data[,3], xlab="Location", zlab="var 2", ylab="var 1", lab = c(10, 5, 2), x.ticklabs = c(1, rep("", 5), 7, "", "", 10)) Uwe Ligges > 2D: > a<- runif(50) > a2<- qnorm(a) > b<- runif(50) > b2<- qnorm(b) > c<- runif(50) > c2<- qnorm(c) > data<- > rbind(cbind(rep(1,50),a,a2),cbind(rep(7,50),b,b2),cbind(rep(10,50),c,c2)) > plot(data[,1],data[,2],xaxt="n",xlab="Location",ylab="var 1") > axis(1, at= c(1,7,10),labels = c("Loc 1","Loc 2", "Loc 3")) > 3D: > library(scatterplot3d) > scatterplot3d(data[,1], data[,2], data[,3],box=T, col.axis="black", angle= > 45,grid=T, xlab="Location",zlab="var 2",ylab="var 1") > Thank you for your suggestions, > Tonja > > > Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone > und Android. > [1]https://produkte.web.de/freemail_mobile_startseite/ > > References > > 1. https://produkte.web.de/freemail_mobile_startseite/ > ______________________________________________ > [hidden email] 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. ______________________________________________ [hidden email] 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. |
| Powered by Nabble | Edit this page |
