[R] lattice key inside panel

Iago Mosqueira iago.mosqueira at gmail.com
Wed Feb 4 17:21:05 CET 2009


Hello,

I am trying to draw a key inside a single panel in a lattice xyplot. The
panel function uses panel.number() to use a slightly different style for
one of the panels. Once inside than panel I am using

draw.key(list(text=list(lab='catch'),
          lines=list(lwd=c(2)),
          text=list(lab='landings'),
          rectangles=list(col=rgb(0.1, 0.1, 0, 0.1)),
         x=0, y=1, corner=c(0,0)), draw=TRUE)

which gets me the key right in the middle of the panel. I would like to
have at the top or bottom. Changes to the values of x, y or corner do
not seem to change the position at all.

lattice.getOption("legend.bbox") returns 'panel'.

I am quit sure I am missing something essential, but can this be done
without calling directly grid methods?

Thanks,


Iago


-- 
Iago Mosqueira
Systems Modelling
Cefas
Pakefield Rd.
Lowestoft, NR33 0HT
U.K.

Pios, 11
36940 Cangas do Morrazo
Spain




More information about the R-help mailing list