[R] scatterplot3d with densCols ?

Pascal Oettli kridox at ymail.com
Thu Mar 28 11:52:38 CET 2013


Hello,

According to ?scatterplot3d, the option is 'color', not 'col'.

scatterplot3d(mat,color=mcols,pch=16)

HTH,
Pascal


On 28/03/13 19:41, Brian Smith wrote:
> Hi,
>
> I was trying to make a 3D plot using densCols. The documentation for
> densCols doesn't look like it'll work for 3D. For example:
>
> -----------------------------------------
> library(scatterplot3d)
>
> v1 <- rnorm(10000)
> v2 <- rnorm(10000)
> v3 <- rnorm(10000)
>
> ## 2D with denscols
> mat1 <- cbind(v1,v2)
> mcols1 <- densCols(mat1)
> plot(mat1,col=mcols1)
>
> mat <- cbind(v1,v2,v3)
> mcols <- densCols(mat) ## No go?
>
> ## 3D version with no densCols parameter
> scatterplot3d(mat,pch=16)
>
> ## gives error
> scatterplot3d(mat,col=mcols,pch=16)
>
> -----------------------------------------
>
> Is there any workaround/modification to the densCols function that might
> make this work?
>
> thanks!
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list