Hi, anyone has experience with 3D plot (ex: in package RGL) I have a question, I draw a 3D plot of country, year and sales in z axis but when the type is "h" then it's ok but when I want to link the points and type is 'l' lines it's a mess Is there a way to link the points only in one direction? For example a unique line from each country through each year? The code example is below library(rgl) data=read.csv("c:/datout.csv", header=T) Colors=as.vector(data[,1]) dat=as.vector(data[,2]) Year=as.vector(data[,3]) Country=as.vector(data[,4]) Sales=as.vector(data[,5]) Sales=as.matrix(Sales) plot3d(Year, dat, Sales, type="h", axes=F, lwd=5, xlab="Year", ylab="Country", zlab="Sales", col=Colors, main="Typherix: Country/Year/Sales") ##replacing type="l" makes a connections all around, I want only one per country axis3d("x", nticks=10, cex=0.7) axis3d("z", nticks=5, cex=0.7, las=2) axis3d("y", labels=Country, las=2, nticks=20, cex=0.5) -- View this message in context: http://r.789695.n4.nabble.com/3D-plot-RGL-tp3798754p3798754.html Sent from the R help mailing list archive at Nabble.com.
francogrex wrote on 09/08/2011 08:08:19 AM:> > Hi, anyone has experience with 3D plot (ex: in package RGL) I have a > question, I draw a 3D plot of country, year and sales in z axis but whenthe> type is "h" then it's ok but when I want to link the points and type is'l'> lines it's a mess Is there a way to link the points only in onedirection?> For example a unique line from each country through each year? > > The code example is below > > library(rgl) > data=read.csv("c:/datout.csv", header=T)You will get more help from readers of this list if you supply example data such that anyone can run the code that you share. Jean> Colors=as.vector(data[,1]) > dat=as.vector(data[,2]) > Year=as.vector(data[,3]) > Country=as.vector(data[,4]) > Sales=as.vector(data[,5]) > Sales=as.matrix(Sales) > > plot3d(Year, dat, Sales, type="h", axes=F, lwd=5, > xlab="Year", ylab="Country", zlab="Sales", col=Colors, > main="Typherix: Country/Year/Sales") ##replacing type="l" makes a > connections all around, I want only one per country > axis3d("x", nticks=10, cex=0.7) > axis3d("z", nticks=5, cex=0.7, las=2) > axis3d("y", labels=Country, las=2, nticks=20, cex=0.5)[[alternative HTML version deleted]]