[R] "pos" in panel.text

Deepayan Sarkar deepayan.sarkar at gmail.com
Sat Oct 15 17:15:42 CEST 2011


On Mon, Oct 10, 2011 at 6:31 PM, Allan Sikk <a.sikk at ucl.ac.uk> wrote:
> Here's the code. The problem seems to be specific for lattice as I can
> easily use a vector with pos in "plot".

lattice::panel.text() does not support vector 'pos'. (Not very
difficult to fix, and I'll put it on my TODO list). For now, you will
need to use separate calls for different 'pos' values.

-Deepayan

> trellis.device(,width=600, height = 400)
> xyplot(Npop~Narea,
> scales=list(x=list(log=TRUE, at=my.at,labels = formatC(my.at, big.mark =
> ",", format="d")),
> y=list(log=TRUE, at=c(1,10,100,1000,10000,100000,1000000))),
> panel=function(...) {
>     panel.xyplot(..., type="p", col="black", cex=.5, pch=20)
>     panel.text(x=log10(Narea), y=log10(Npop), lab=t,  cex=.5, pos=c(4,2))
>         }
>
> )



More information about the R-help mailing list