[R] L-shaped boxes with lattice graphs?

Felix Andrews felix at nfrac.org
Mon Nov 15 07:45:26 CET 2010


Hi John,

Here is an example with plot borders on the left and bottom only.

## hide the usual panel and strip borders by using "transparent" NA
sty <- list()
sty$axis.line$col <- NA
sty$strip.border$col <- NA
sty$strip.background$col <- NA

xyplot(11:14 ~ 1:4 | rep(c("A", "B"), 2),
    scales=list(x=list(alternating=FALSE, relation="sliced")),
    par.settings = sty,
    panel = function(...) {
        grid::grid.lines(x = 0); grid::grid.lines(y = 0)
        panel.xyplot(...)
    },
    layout=c(1,2))

Hope that helps

-Felix


On 15 November 2010 11:00, John Maindonald <john.maindonald at anu.edu.au> wrote:
> Can anyone suggest an equivalent, for lattice graphs,
> of the base graphics argument bty="l"?
>
> NB that I am leaving off the box around the strip,
> with a strip function:
> stripfun <- function(which.given,which.panel,
>                         factor.levels=as.expression(levlist), ...){
>      panel.text(x=0, y=0.5,
>                 lab = as.expression(levlist[which.panel[which.given]]), adj=0)
>    }
>
> e.g.
> levlist <- list("A", "B")
> xyplot(11:14 ~ 1:4 | rep(1:2,2), scales=list(x=list(alternating=c(1,1), relation="sliced")), strip=stripfun, layout=c(1,2))
>
>
> John Maindonald             email: john.maindonald at anu.edu.au
> phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
> Centre for Mathematics & Its Applications, Room 1194,
> John Dedman Mathematical Sciences Building (Building 27)
> Australian National University, Canberra ACT 0200.
> http://www.maths.anu.edu.au/~johnm
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Felix Andrews / 安福立
http://www.neurofractal.org/felix/



More information about the R-help mailing list