[R] Lattice trellis.focus() with pdf

Chris Poliquin poliquin at sas.upenn.edu
Thu Jan 1 00:41:51 CET 2009


Hi,

I have a the code for a plot that works perfectly running in R and  
printing to a Quartz object but which doesn't work when I make the  
trellis device a pdf.

The code is as follows:
----

trellis.device(device="pdf", new=TRUE)
trellis.par.set(my.theme())
dotplot(Y ~ X | C, groups=G, data=D, layout=c(2,1), ... )

trellis.focus("panel", 1, 1)
for (y in 1:5) {
	panel.segments(...)
}
trellis.unfocus()

trellis.focus("panel", 2, 1)
for (y in 6:10) {
	panel.segments(...)
}
trellis.unfocus()

dev.off()

----

The first for loop draws perfectly but the next panel never takes the  
focus and doesn't draw anything.  The resulting file has the red focus  
box around the first panel still when the commands finish.  Again,  
everything is fine when the device is a Quartz object.

- Chris




More information about the R-help mailing list