R Cairo PDF字体在Adobe Illustrator中无法读取。

3
我无法将使用Cairo包创建的PDF文件在Illustrator中打开并显示可读文本。这是为什么?是否有任何建议?
library(ggplot2)
library(Cairo)
df = data.frame(x=rnorm(2000), y=rnorm(2000), v=abs(rnorm(2000)^5))
p = ggplot(df, aes(x, y)) + 
  geom_point(aes(col=v, size=v), alpha=0.75) +
  scale_size_area(max_size = 10)
print(p)

Cairo(file='out/plot.pdf', type='pdf', width=4, height=4, bg="transparent", unit="in", dpi=72) 
p
dev.off()
browseURL('out/plot.pdf')

这个文档在R中看起来很好,当在SumatraPDF等软件中打开pdf时也没问题,但是在Illustrator中打开时却变成了这样:

enter image description here


这实际上只是您的Illustrator设置的问题。 - IRTFM
好的,ggsave没有这个问题,但它会创建椭圆形,而在Illustrator中读取为q,因此需要使用Cairo。 - geotheory
1个回答

0

使用ggplot2函数ggsave,带参数useDingbats=FALSE

ggsave(plot=p,height=6,width=6,dpi=200, filename="plot.pdf", useDingbats=FALSE)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接