Skip to content

R versions and PostScript files

1 message · Brian Ripley

#
On Fri, 22 Jul 2011, James Cloos wrote:
Please do note the posting guide: the context you omitted (when 
explicitly asked not to) is in the thread starting:

https://stat.ethz.ch/pipermail/r-help/2011-July/284352.html
No discernable difference on the viewers I tested.
I've not seen a printer driver which does that for many years.  But 
remember that R's postscript() has origins in  the mid-1990s.

R's pdf() is newer (R 1.3.0, 2001) and even by then the optimization 
could safely be left to the driver.
Actually no, as it can do that rather often.  Consider the pairs plots 
of the iris data in demo(graphics): that does (1200 times)

switch to red, blue or green
fill circle
switch to black
draw circle outline.

Some viewers are rather slow in running that procedure, and on those 
viewers this example is slow.

Workarounds:

1) Use pdf(), where the viewers seem to cache colorspaces.
2) In R-patched, use colormodel="rgb-nogray", which never switches 
colorspace ("srgb-nogray" in R-devel).
3) In R-devel, use colormodel="rgb" (rather than "srgb") and give up 
the colour accuracy (if your viewer is not already set for sRGB) for 
speed.
Hmm, you seem not to understand how the code works.  The postscript 
macro /bg switches colour, and the macros /p3 and similar use 
different colorspaces during their execution.  It isn't just SetColor 
as its setting may not be used immediately.