Skip to content
Prev 205826 / 398506 Next

lattice, add text to xyplot

On 2010.01.08 19:44:39, Ivan Gregoretti wrote:
A <- data.frame(x = rnorm(100), y = rnorm(100))
xyplot(y ~ x, data = A,
       panel = function(...) {
         panel.text(0, 0, "Hello world!")
         panel.xyplot(...)
       })

A whole lot of examples lattice are available here:

http://lmdvr.r-forge.r-project.org/figures/figures.html

If you plan on using lattice often, I highly recommend Deepayan Sarkar's
book.

Hope that helps,
~Jason