[R] trellis plot
Jerome Asselin
jerome at hivnet.ubc.ca
Fri Mar 21 20:07:10 CET 2003
Hi Latif,
You need to build your own panel function that will fit your purpose.
This will do what you want, but it's not very elegant. A better solution
would have the panel function depend on the value of z. Any other suggestions
on own to do this?
Jerome
library(lattice)
x <- c(rep(LETTERS[1:4],13), rep(LETTERS[4:1],12))
y <- rnorm(100)
z <- rep(1:2,50)
x <- c("A","B",x)
y <- c(-1.5,-2.5,y)
z <- c(1:2,z)
bwplot(y~factor(x)|z,layout=c(2,1), panel=function(x,y)
{
panel.bwplot(x[-1],y[-1],horizontal=F)
panel.xyplot(x[1],y[1],pch=20,cex=2,col="red")
})
On March 21, 2003 06:00 am, you wrote:
>
> Hi there,
>
> I need some help about trellis plot. I have the following plot.
>
> x <- c(rep(LETTERS[1:4],13), rep(LETTERS[4:1],12))
>
> y <- rnorm(100)
> z <- rep(1:2,50)
> bwplot(y~factor(x)|z,layout=c(2,1), panel=function(x,y)
panel.bwplot(x,y,horizontal=F))
>
>
> Now I want to place "*" on the positions (1,-1.5) in the first panel and
(2,-2.5) in the second panel. I need help on this.
>
>
>
> Thanks.
>
>
>
> Mahbub.
More information about the R-help
mailing list