1

我需要将 R 中的 par 图保存为高分辨率 tiff 文件,并使用 CMYK 颜色模型发布到特定期刊。我尝试过类似以下的事情:

tiff("test.tiff", colormodel = 'cmyk')

代码....

par(mfrow=c(1,2))
plot()

更多代码..

par(new=TRUE)
plot()

不幸的是,它不起作用。

我也尝试过 EPS,但发布网站有这个在线艺术品质量测试仪,并且由于分辨率太低而导致 EPS 文件失败。

这是一个与我需要的概念类似的工作示例。

tiff(file = "test.tiff", res = 1200, colormodel = 'cmyk') 
par(mfrow=c(1,2)) 
plot(1,3)             
par(new=TRUE) 
plot(3,5) 
plot(2,3) 
par(new=TRUE) 
plot(4,2) 
dev.print(tiff, file = "test.tiff", width = 1680, height = 1050)

这仍然行不通。发布网站说它仍然是RGB格式,分辨率只有72 dpi。有什么想法吗?

4

1 回答 1

1

You can generate a png file (in the RGB space) in R

png("/tmp/a.png", width=6, height=6, units="cm", res=1200)
plot(1)
dev.off()

and convert it to TIFF outside R. For instance, with ImageMagick:

convert -colorspace CMYK a.png a.tiff
identify -verbose a.tiff   # To check the result
# Image: a.tiff
#   Format: TIFF (Tagged Image File Format)
#   Class: DirectClass
#   Geometry: 2834x2834+0+0
#   Resolution: 472.44x472.44
#   Print size: 5.99865x5.99865
#   Units: PixelsPerCentimeter
#   Type: ColorSeparation
#   Base type: ColorSeparation
#   Endianess: MSB
#   Colorspace: CMYK
#   ...
于 2013-08-21T13:56:10.317 回答