[R] Tick marks in cloud (lattice)

Deepayan Sarkar deepayan at stat.wisc.edu
Wed Sep 1 17:09:25 CEST 2004

Pär Matsson wrote:
> Hi! Probably a simple question, but I can't get any tick marks in the 3d 
> scatterplot I created using the cloud function.
> The following works to display the three groups using different symbols:
> data(iris)
> cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = 1.2, 
> groups = Species, pch = c(16,1,1), col = c("black","black","red"), 
> subpanel = panel.superpose, screen = list(z = 50, x = -80, y = 0), 
> par.settings = par.set)
> What should I add in order to get tick marks on the x, y, and z axes? I 
> would like to use this for my own data, with tick marks preferably at 
> defined positions [in original scale] for each axis.

help(cloud) says:

   scales: describes scales. Can contain lists named x, y and z. Arrows
           are drawn if 'arrows=TRUE', otherwise tick marks with labels
           are drawn. Both can be suppressed by 'draw=FALSE'. Several
           other components that work in the usual 'scales' argument
           also work here (see 'xyplot').

(which I guess could use a bit more work). So you need to add

  scales = list(arrows = FALSE)

to your cloud call. For finer control, you really need to read the entry 
for scales in help(xyplot), after which the following should make sense.

cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris,
       scales = list(arrows = F, x = list(at = 3:5)))


More information about the R-help mailing list