Re: [S] Adjusting Trellis plot.symbol

Prof Brian Ripley (ripley@stats.ox.ac.uk)
Sun, 15 Mar 1998 07:45:04 +0000 (GMT)


Kevin Brand wrote:

You were almost there:

> > tmp_trellis.par.get("plot.symbol")
> > tmp$.cex <- 2
tmp$cex <- 2 # no period.

> > trellis.par.set("plot.symbol",tmp)
> > stripplot( ... )
>
> 2) I'm also trying to add dotted lines similar to those plotted in
> dotplot() default.
>
You need to use a new panel function. (Why not start with dotplot, though?)
Something like

mypanel <- function(x, y, jitter.data = F, mycex=0.8, ...)
{
# from panel.dotplot
ok <- !is.na(x) & !is.na(y)
dot.line <- trellis.par.get("dot.line")
abline(h = unique(y[ok]), lwd = dot.line$lwd, lty = dot.line$lty,
col = dot.line$col)
# from panel.stripplot and panel.xyplot
if(jitter.data) y <- jitter(y)
plot.symbol <- trellis.par.get("plot.symbol")
points(x, y, pch = plot.symbol$pch, font = plot.symbol$font,
cex = mycex, col = plot.symbol$col, ...)
}
stripplot(..., panel=mypanel, mycex=2)

will do both questions at once. (I got this by looking at panel.stripplot
and panel.dotplot and combining them.)

> Any suggestions to make this work in V3.3 would be great, however, if
> you only have suggestions on how to do the same in V4.0, I would
> appreciate them as well.

The only differences in Trellis are bug fixes between 3.3 (for
Windows) and 4.0, as far as I remember.

> On a more general note, is there a reference that would be useful in
> better understanding how to work with Trellis plots ? My current
> reference is the V3.3 Trellis Users Manual.

The only other printed source I know is chapter 3 of the second edition of
Venables & Ripley. I would think that is better, of course. There are
also on-line sources at the Trellis Web site (mentioned in that manual,
although I believe it has moved).

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news