Re: [R] Lattice wireframe: How to avoid drawing lines around polygons when using shade=TRUE

From: Oliver M. Haynold <inquiries_at_haynold.com>
Date: Sun, 27 Jul 2008 08:41:27 +0000 (UTC)

On Sun, 27 Jul 2008 05:00:48 +0000, Oliver M. Haynold wrote:
> I am using wireframe from the lattice package, with the shade option set
> to TRUE. When I output to PDF or Postscript, a line gets drawn around
> each polygon of my surface which causes ugly Moiré effects and doesn't
> make sense in my application (think the plot of Maunga Whau--gridlines
> don't make sense). This does not happen when I display on the screen--
> then I just get the surface as intended.

I have done some research on the problem. On inspection of the PDF file generated by lattice, it turns out that it does not actually contain any instructions to draw lines between the triangles of the surface plot. Yet, Evince and Acrobat Reader both show these lines, with disagreeable consequences for printing and screen display. Ghostscript, however, does not and renders the surface as a solid block, as it should be. Thus, a workaround for the problem is to put the file generated by lattice through Ghostscript and to convert it into a high-resolution image file.

The most likely reason for the problem I can think of is that the triangles generated by lattice don't overlap but just border each other. This might cause some renderers to leave a little space between them. If this explanation is correct, a solution would be to have lattice, or specifically wireframePanelCalculations, plot the triangles with a tiny bit of overlap.

Best,

        Oliver



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 27 Jul 2008 - 08:46:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Jul 2008 - 00:33:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive