0

我正在尝试使用 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()

http://i.minus.com/ibj8wqtqXsyZqN.svg

http://i.minus.com/ibult36ExZJ75o.png

4

0 回答 0