[R] White lines on persp plots in pdf format

Marc Schwartz marc_schwartz at me.com
Thu Nov 17 21:40:57 CET 2011


On Nov 17, 2011, at 10:13 AM, Miguel Lacerda wrote:

> Hi,
> 
> I am using the persp function to plot 3D surfaces, but the plots have
> "little white lines" when I print them to a pdf file (visible in
> Acrobat, Foxit, Evince, Xpdf and Gimp). This does not happen when I
> create png or tiff images. Here is some sample code:
> 
> pdf("test.pdf")
> 
> x <- seq(0,1,length=101)
> 
> f <- dnorm(x, 0, 0.25)
> 
> z <- c()
> 
> for(i in 1:100) z <- cbind(z,f)
> 
> persp(z, col="red",theta=40, phi=10, shade=1.5, d=4, border=NA)
> 
> dev.off()
> 
> The resulting graph is attached. Anyone know how to get rid of the
> "little white lines"?
> 
> Thanks!
> Miguel


See:

  http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-there-unwanted-borders

and the "Note" section of ?pdf.

HTH,

Marc Schwartz



More information about the R-help mailing list