[R] change font size within the panel.text function (package lattice)

David Winsemius dwinsemius at comcast.net
Sun Jul 12 02:09:55 CEST 2015


On Jul 11, 2015, at 4:46 PM, Luigi Marongiu wrote:

> Dear all,
> I am adding some text to the panels of a graph generated through the
> lattice function using the argument:
>   xyplot( ...,
>              panel =
>               function(x, y,...)
>               {
>                   panel.xyplot(x,y,...)
>                   panel.text(0,0,labels=V[panel.number()])
>               }
> 
> How can I regulate the font size of such text?

library(lattice)
  A <- data.frame(x = rnorm(100), y = rnorm(100))
  xyplot(y ~ x, data = A,
  panel= function(x,y,...){panel.points(x,y,...)
                           panel.text(0.5, 0.2, "Hello, world", cex=3)}
        )


> 
> Best regards
> luigi
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list