Skip to content

Adding text in the panels for Trellis plot ...

2 messages · ychu066, Deepayan Sarkar

#
i was trying to do a for loop for plotting the histograms , but it doesnt
work properly
+ {   
+   plots[[ j <- j+1 ]] <- histogram( ~ data[,i] | data[,2],ylab =
"Frequency", 
+   xlab = "Score", xlim = c(1,5), ylim = c(0,100),layout=c(3,1), 
+   main = c(colnames(data)[i],"index",j+1),mycolors =
colors()[c(536,552,652,254,26)], 
+   panel = function(..., col, mycolors) { 
+   panel.histogram(..., col = mycolors[panel.number()])}) 
+ trellis.focus('strip', 1, 1, highlight=FALSE) 
+ ltext(0.60, -0.25, 'PPM', col='blue', pos=3) 
+ trellis.unfocus() 
+ }   
Error in grid.Call.graphics("L_downviewport", name$name, strict) : 
  Viewport 'plot1.strip.1.1.vp' was not found
I am not sure what was happeneing. . . can anyone help me ?
1 day later
#
On Thu, Nov 26, 2009 at 6:22 AM, ychu066 <ychu066 at aucklanduni.ac.nz> wrote:
Panel functions are for controlling the panel display. If you want to
control the strip, use the 'strip' argument to provide a custom strip
function.

-Deepayan