I am trying to print graphs as pdf's or eps in a for loop, but I can't seem
to get it right

 

Either it prints only a single eps graph (overwrites) or when I use
#pdf(paste(i,".pdf", sep="")) .. it prints all pdf's but they are empty

 

Can someone suggest which method shud I use for such.

 

Thanks

Mohan

 

Code:

 

for(i in 1:19) {

  query <- d$V1[i];

  print(query)

  

  #pdf(paste(i,".pdf", sep=""));

  

  x11();

  plot(c2data[start1:count,],c3data[start1:count,],xlab="Buildings",
ylab="Sky", sub=i); 

  points(c2data[query,],c3data[query,], pch=20, col='blue');

  

  grid();

  

 dev.print()

 dev.copy2eps();

 dev.copy()

  

  start1 <- count + 2;

  #print(start1)

  val <- val-1;

  #print(val)

  count <- count + val;

  #print(count)

}


	[[alternative HTML version deleted]]


