[R] overdrawing a plot

From: Gallego Liberman, Matias <m.gallego_at_isofoton.com>
Date: Wed, 20 Feb 2008 09:26:49 +0100


Hi helpers.  

I have the following problem and I need some help When using grid.edit inside a pdf device it applies the changes on a second plot, not erasing the first one.
Here it is an example.  

>DF<-data.frame(A=c(1:12),B=c(1:12)*c(rnorm(12,mean=1)),C=2*c(1:12),D=re
p(c(1:4),each=3))
>trellis.device(pdf,file='prueba.pdf')
>ggplot()+geom_line(mapping=aes(x=A,y=B,colour=D),data=DF)
>grid.edit(gPath('legend'),gp=gpar(fontsize=8),grep=TRUE,redraw=TRUE)
>dev.off()
 

produces a two pages pdf document, one with and one without the changes inttroduced by grid.edit  

If I use  

>DF<-data.frame(A=c(1:12),B=c(1:12)*c(rnorm(12,mean=1)),C=2*c(1:12),D=re
p(c(1:4),each=3))
>trellis.device(pdf,file='prueba.pdf')
>ggplot()+geom_line(mapping=aes(x=A,y=B,colour=D),data=DF)+grid.edit(gPa
th('legend'),gp=gpar(fontsize=8),grep=TRUE,redraw=TRUE)

it produces the error:  

Error en editDLfromGPath(gPath, specs, strict, grep, global, redraw) :   'gPath' (legend) not found  

May anybody tell me how to save just the edited plot on the pdf file?  

Thanks in advance

        [[alternative HTML version deleted]]



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. Received on Wed 20 Feb 2008 - 08:30:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 20 Feb 2008 - 14:00:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive