I'm trying to do some post-plot manipulation of some lattice graphics, in which 
I need to get the absolute viewport locations on the plotting device. So for 
example:

library(lattice)
print(xyplot(Petal.Length ~ Sepal.Length | Species, iris, layout = c(2, 2)))
trellis.focus('panel', 1, 1)

This shows the item I want to identify. I need to know, for example, that the 
lower left corner of the highlighted panel is at (0.1, 0.1) of the plotting 
device. Hopefully there's some grid shenanigans I can use to do so.

To put the question into context (in case there's an alternative way): I'm 
constructing PDF reports that are an amalgam of PDF figures, constructed 
through LaTeX programmatically constructed in R, and I'd like to be able to add 
tooltips to some of the data points on the graphs. To do so, I'm overlaying a 
tikz (empty) image that uses the pdfcomment package to add the tooltips. Hence 
I need to be able to calculate where some of the points are on the screen so I 
can calculate where to put the tooltip 'hit-zones'. This would be fairly 
trivial using javascript / actionscript and mouseover hooks, but I'm 
constrained by PDF. 

Thanks,
Jim Price.
Strength in Numbers.

                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to