[R] R versions and PostScript files

James Cloos cloos+r-help at jhcloos.com
Fri Jul 22 19:12:31 CEST 2011


I suspect that a few s/def/bind def/ on that prologue might improve
things a bit.

The ps R creates freely switches between the sRGB ABC space and
setgray.  That is a good thing; it helps ensure that black will
be just black when sent to a CMYK device.  Without that you can
get CMY black from some devices.  But it does complicate things.

(CMYK devices often use CMY black rather than K black when the
source is RGB black because it is better when printing contone
images, such as photographs.  But it just wastes ink and toner
when printing charts and similar graphics.)

The best improvement would be to have R keep track of the last
colorspace and only run the srgb procedure when switching from
DeviceGray, rather than every time it changes the RGB colour.

The SetColor() function in R/src/library/grDevices/src/devPS.c
looks to be the place to do that.  The Invalidate() function
and the PostScriptDesc struct there also need to track any
such changes.

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



More information about the R-help mailing list