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]]

