[R] Aid with 3-D scatterplots

Deepayan Sarkar deepayan at stat.wisc.edu
Wed Mar 9 20:26:18 CET 2005


On Wednesday 09 March 2005 13:17, Jim and Chana Milks wrote:
> I am attempting to classify pixels from a Landsat image by using their
> associated numbers in bands 2, 3, and 4 (It's from an assignment on
> classification).  To aid me, I want to create a 3-D scatterplot using
> the "cloud" command.  Due to my ignorance of the finer plotting
> functions, I am unable to display the scale on the three axes or to
> display the grid.
>
> My dataframe (RS) contains four columns: Class, band2, band3, band4.
> Class is the classification variable (vegetation, water, soil, etc.)
>
> The basic code I used was:
> cloud(band4~band2*band3,RS,xlab="TM Band 2",ylab="TM Band 3",zlab="TM
> Band 4",group=RS$Class).

Just 'groups = Class' should work.

>
> Unfortunately, I'm unsure which arguments to use and how to write them
> in.  I've tried adding arguments using "scale", but have not been
> successful, mostly because I'm unsure which arguments apply.  The scale
> I want for all three axes is 0-100.

You want 

cloud(..., xlim = c(0, 100), ylim = c(0, 100), zlim = c(0, 100))

and perhaps 
 
cloud(..., xlim = c(0, 100), ylim = c(0, 100), zlim = c(0, 100), 
      scales = list(arrows = FALSE))

-Deepayan




More information about the R-help mailing list