[R] the huge postscript plot

Philippe Glaziou glaziou at pasteur-kh.org
Sat Jul 5 03:46:55 CEST 2003


Yongchao Ge <gyc at stat.berkeley.edu> wrote:
> I'm just wondering how I can do to make a huge postscript plot be
> manageable. My question is that I have to draw around 60,000 points which
> makes it painfully slow to print or view in gv or put it into latex
> document, though it is very fast to produce the postscript file.
> 
> A simple example is in the attachment.
>
> 
> x<-1:2000
> y<-matrix(rnorm(2000*12),2000,12)
> for(i in 1:12){
>     y[,i]<-sort(y[,i]+i*0.5)
> }
> postscript("try.ps")
> matplot(x,y,type="l",lwd=5)
> dev.off()


How about sampling a subset of the data:

  sub=sort(sample(x,200, replace=F))
  postscript("try.ps")
  matplot(x[sub],y[sub,],type="l",lwd=5)     
  dev.off()


-- 
Philippe




More information about the R-help mailing list