3

I have an issue with the exportation of my plots in Rstudio. The result is not the same when I export a plot in a classic image format (png, jpg...) than when I try in pdf. Differences are not very big (different places of legend, overlaying...) but it is a bit frustrating. Any ideas to solve the problem ?

pdf version

png version

4

1 回答 1

7

pdf是一种矢量格式,您可以在其中指定导出图的widthheight默认情况下以英寸为单位 ( 7),而png是光栅图像,其中widthheight以像素为单位指定,并带有可选传递的res参数(默认为72)。

因此,请尝试为图像设置相同的尺寸,并将widthandheight参数更改为png7*72=504而不是480

于 2013-06-05T10:48:13.953 回答