4

I'm trying to plot a 3d scatterplot (let's use this previous question as an example), but as a grid with multiple 3D scatterplots on the same page based on a categorical factor. I see how many people can do this with, for example, boxplots, but have no idea how to do so with a 3-d scatterplot. Any thoughts would be very helpful.

Community
  • 1
  • 1
AndMan21
  • 533
  • 1
  • 4
  • 15

1 Answers1

2

You can do this with the cloud function in the lattice package, although it probably doesn't offer as much easy fine-scale control as scatterplot3d- or rgl-based plots:

set.seed(101)
d <- data.frame(x=runif(1000),y=runif(1000),z=runif(1000),
  f=factor(sample(1:10,replace=TRUE,size=1000)))
library("lattice")
cloud(z~x*y|f,data=d)
rawr
  • 20,481
  • 4
  • 44
  • 78
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453