box colours in lattice (was RE: [R] Strip location and grid colourin Lattice)

Tom Mulholland tmulholl at bigpond.net.au
Thu Jun 5 16:07:33 CEST 2003


Despite my assertion that I had checked all the lattice theme components, I
was in error. Having made the appropriate changes in print.trellis and
succeded in what I wanted to do, I noticed obvious trellis.par.get calls and
followed them up. In the end what I required did not take much at all. This
amended xyplot example shows roughly what I was trying to get to.

require(lattice)
SetColGrey <- function(x=NULL)
{
lset(list(background = list(col = "transparent"),
add.text=list(col="grey50",cex=1.3),
axis.line=list(col="grey95"),
regions = list(col = c("navy","steelblue2")),
strip.shingle = list(col = c("grey75")),
strip.background = list(col = c("white"))))
}

SetColGrey()
data(barley)
     barchart(yield ~ variety | site, data = barley,
              groups = year, layout = c(1,6),
              ylab = list("Barley Yield (bushels/acre)",col="grey"),
              scales = list(col="grey25",x = list(abbreviate = TRUE,
                            minlength = 5)),
	        between=list(y=1.5))

Thank you everyone for your help, it has been very much appreciated.

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Prof Brian Ripley
Sent: Thursday, 5 June 2003 4:20
To: Mulholland, Tom
Cc: (r-help at stat.math.ethz.ch)
Subject: box colours in lattice (was RE: [R] Strip location and grid
colourin Lattice)


If you mean the rectangular boxes surrounding the panels and strips, they
are drawn by grid.rect() and not under the control of lattice.

If so, it is *not* a grid but a series of boxes, and they don't always
align perfectly, as example(xyplot) shows on my screen (and if you
had some space between the plots this would be clearer to you).

You could alter the grid.text calls in print.trellis to change the colour
....

On Thu, 5 Jun 2003, Mulholland, Tom wrote:

> I am not using panel.grid directly. It appears to use the reference.line
> component of the lattice.theme. Since I have tried changing all obvious
> comonents in the lattice.theme (including reference.line) I assume I am
> correct in this assertion.
>
> I probably used the wrong word, but I wasn't sure what else to call it. It
> is the grid around each plot and strip. It dominates the trellis
...(that's
> what I should have called it). How do you change the colour of the
trellis?
>
>
> -----Original Message-----
> From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk]
> Sent: Wednesday, 4 June 2003 6:26 PM
>
> What grid?  You put it there, and you can change its colour.  It comes
from
> calling panel.grid, and arg(panel.grid) will hint to you how to change
this.
>
>
>

--
Brian D. Ripley,                  ripley at 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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list