[R] the huge postscript plot

Adaikalavan Ramasamy gisar at nus.edu.sg
Sat Jul 5 07:38:28 CEST 2003


How about pdf(), jpeg() or png() ?

-----Original Message-----
From: Philippe Glaziou [mailto:glaziou at pasteur-kh.org] 
Sent: Saturday, July 05, 2003 9:47 AM
To: r-help at stat.math.ethz.ch
Subject: Re: [R] the huge postscript plot


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

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list