On Sun, 29 Nov 2020 at 20:55, Derek M Jones <de...@knosof.co.uk> wrote: [...] > > library("colorspace") > > two_c=rainbow(2) > x=runif(20) > y=runif(20) > plot(x, y, col=two_c[2]) > pdf(file="cmyk.pdf", colormodel="cmyk") > plot(x, y, col=two_c[2]) > dev.off()
rainbow(2) gives two RGB-colours: #FF0000 (=pure red) and #00FFFF (=pure cyan). So it should be no problem to match two_c[2] perfect in CMYK-colourspace However after some testing. I totally agree that CMYK handling in R using pdf(..., colormodel = "cmyk") is not correct. One solution: Output in tiff or png instead and then convert to CMYK using external tools. Try this: png("plot.png") plot(runif(10), runif(10), col = ""#00FFFF") # cyan dev.off() And then convert plot.png using: https://www.online-utility.org/image/convert/to/CMYK Regards Martin [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.