我正在尝试使用R的Cairo库创建视觉上相同的图(假设相同的DPI)。但是,尽管设置相同,但PNG和SVG输出明显不同。我在Windows 7上运行R 2.15.2。示例和插图如下。
更新:这些看起来更相似,但仍然不同。
library( Cairo )
library( lattice )
cars_xyplot = xyplot( speed ~ dist, data = cars )
Cairo( file = 'temp.png', type = 'png', dpi = 120, pointsize = 12, bg = "white", units = "mm", width = 100, height = 100 )
plot( cars_xyplot )
dev.off()
Cairo( file = 'temp.svg', type = 'svg', pointsize = 12, bg = "white", units = "mm", width = 100, height = 100 )
plot( cars_xyplot )
dev.off()
http://i.minus.com/itsJoNPU2iRZK.svg
http://i.minus.com/ibagje4DmtcA1u.png
原文:剧烈差异
library( Cairo )
library( lattice )
cars_xyplot = xyplot( speed ~ dist, data = cars )
Cairo( file = 'temp.png', type = 'png', dpi = 120, pointsize = 12, bg = "white" )
plot( cars_xyplot )
dev.off()
Cairo( file = 'temp.svg', type = 'svg', dpi = 120, pointsize = 12, bg = "white" )
plot( cars_xyplot )
dev.off()