[R] Saving interactive modified latttice plots?

Greg Snow Greg.Snow at imail.org
Wed Dec 2 21:09:14 CET 2009


Look at ?dev.copy

I ran your code, clicked on some points, then did:

> dev.copy2pdf(file='c:/temp/test.pdf')

And found the pdf file complete with the labeled points.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Derek Eder
> Sent: Monday, November 30, 2009 4:25 AM
> To: r-help at r-project.org
> Subject: [R] Saving interactive modified latttice plots?
> 
> The lattice function panel.identify() allows the labeling of mouse-
> selected plot points.
> 
> But ... how does one save the resulting plot? E.g., to png() or pdf()
> 
> Thank you!
> 
> 
> 
> # example code
> library(lattice)
> xyplot(rnorm(10,0,1)~rnorm(10,0,1))
> trellis.focus() # left click on plot panel to select
> panel.identify() # left click on selected points.  Right click to exit
> process
> trellis.unfocus()
> 
> 
> 
> Derek N. Eder
> Gothenburg University
> 
> "The most dangerous thing in the jungle is not the snakes, the spiders,
> the tigers, ...
> The most dangerous thing in the jungle is your mind!"
> 
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list