Skip to content

annotating individual panels produced by xyplot

3 messages · Martin Brown, Deepayan Sarkar

#
Hi all,

I'm new to R and lattice and panel functions.  I've produced a lattice
graph using xyplot.  Now I would like to add various, and *different*,
annotations to each individual panel.  I tried something like this,
using panel.text  ...

<code>
xyplot(dent ~ era | vegzone,
           groups=seedtype,
			panel=function(...) {
				panel.xyplot(...)
				panel.text(6.5,50,labels="my 1st annotation")
				panel.text(6.5,70,labels="my 2nd annotation")  } )
</code>

... but that didn't work, as both annotations appeared in all panels.
I want to control which panel each annotation appears in.  I feel
there must be a way to assign the contents of panel text to individual
panels, or to make a list of coordinates and annotations and have them
meted out over the various panels.  However, I've searched through the
R-help archives and just can't figure it out.

Any tips would be appreciated.  Thanks so much!

Martin John Brown
Portland, Oregon, USA
http://martinjohnbrown.net
#
On Tue, Sep 2, 2008 at 1:23 PM, Martin Brown <mjb2000 at gmail.com> wrote:
See ?packet.number

-Deepayan
#
That helped -- got it working.  Thanks! -mjb

On Tue, Sep 2, 2008 at 1:28 PM, Deepayan Sarkar
<deepayan.sarkar at gmail.com> wrote: