[R] Help needed with lattice graph!

From: Sander Oom <slist_at_oomvanlieshout.net>
Date: Fri 22 Apr 2005 - 18:29:53 EST


Dear R users,

If I manage to sort out this graph, it is certainly a candidate for the new R graph gallery
(http://addictedtor.free.fr/graphiques/displayGallery.php)!

I created the following lattice graph:

library(lattice)
tmp <- expand.grid(geology = c("Sand","Clay","Silt","Rock"),

   species =
c("ArisDiff","BracSera","CynDact","ElioMuti","EragCurS","EragPseu"),

   dist = seq(1,9,1) )
tmp$height <- rnorm(216)
sps <- trellis.par.get("superpose.symbol") sps$pch <- 1:6
trellis.par.set("superpose.symbol", sps)

   xyplot( height ~ dist | geology, data = tmp,

     groups = species, type = "b", cex = 1.2,
     layout = c(2,2),
     lines = list(col="grey"),
     key = list(columns = 2, type = "b", cex = 1.2,
       text = list(paste(unique(tmp$species))),
       points = Rows(sps, 1:6)
       )

   )

However, for once, the R defaults are not to my liking. I plot the graph to postscript and the result is less then optimal.

I would like to plot the point symbols in black and white, both in the graphs and the key. I would like the lines to be a single style (grey or a light dash) and preferably the lines do not go through the symbols
(like figure 4.11 in the MASS book).

I have tried many, many options, but results varied from wrong symbols to wrong things plotted. Splitting the lines and points over different panels seems the way, but I can not make it work.

Your help is much appreciated! This graph and the resulting black and white graph will be posted on the R graph gallery.

Thanks,

Sander.

-- 
--------------------------------------------
Dr. Sander P. Oom
Animal, Plant and Environmental Sciences,
University of the Witwatersrand
Private Bag 3, Wits 2050, South Africa
Tel (work)      +27 (0)11 717 64 04
Tel (home)      +27 (0)18 297 44 51
Fax             +27 (0)18 299 24 64
Email   sander@oomvanlieshout.net
Web     www.oomvanlieshout.net/sander

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Apr 22 18:48:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:22 EST