[R] Text in lattice Graphics outside plot area

From: Bock, Michael <MBock_at_arcadis-us.com>
Date: Thu 03 Mar 2005 - 02:29:52 EST

I am trying to get the same text printed on each page of a multi-page series of bar charts. The text need to appear in the upper left-hand corner of the page, outside of the plot area. A watermark might be the closest analogy to what I am after

This is what I have so far:

PData <- na.omit(subset(TData,Matrix == "Product")) barchart(AdjResND0 ~ reorder(Compound, Sort) | Label , PData,

   box.ratio = 0.8, ylab= ("Concentration (mg/kg)"),    layout = c(0,1), scales = list(x="free",y="free",rot=90,cex = 0.4,    axs = "i" ), panel=function(x,y,...) {

        grid.text(label = "Privileged and Confidential \nDRAFT",
        x = unit(0.01, "npc"), y = unit(0.95, "npc"))})

This plot a bar chart for each sample, with label representing the sample ID. I love getting 30 plots with a small among of code! The problem with this is that the text appears inside the plot area, I need it outside in the corner of the page.

I think I am close, perhaps if I have the text be in the primary panel which would be taking up the whole page with the bar chart inside in a sub panel? An example would be great as I have tried a number of things and I either get errors or "curious" looking plots. The option of last resort would be to explicitly plot each sample and add the text to each plot, but this does not take advantage of the multi-plot capabilities of lattice graphics.

Thanks 10^6 in advance

Michael J. Bock, PhD.
24 Preble St. Suite 100
Portland, ME 04101
fax 207.828.0062

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Mar 03 03:28:50 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:39 EST