为什么Inkscape无法正确读取R生成的PDF文件? [英] Why doesn't Inkscape correctly read PDF files generated by R?

查看:463
本文介绍了为什么Inkscape无法正确读取R生成的PDF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我会在R中绘制图形并以pdf或svg格式导出.然后,将它们导入Inkskape或Illustrator中.有时这会产生奇怪的结果.例如,当我生成具有形状(1和16)的简单散点图时,Inkscape无法读取它并生成以下要点文件.我怀疑这应该是由于pdf()图形设备的默认选项引起的,但是我不确定.有没有人有解决方案?

Very often, I draw graphs in R and export them in pdf or svg. Then I import them in Inkskape or Illustrator. Sometimes this generates weird results. For instance, when I generate a simple scatterplot with shapes (1 and 16), Inkscape in unable to read it and generate the following file. See my gist file. I suspect that this should be due to the default options of the pdf() graphics device but I'm not sure. Does anyone has a solution?

推荐答案

这是使用不同字体作为绘图符号的症状.尝试使用以下方法创建PDF文件:

This is a symptom of different fonts being used as the plotting symbols. Try creating the PDF file using:

   pdf("test.pdf", useDingbats = F) 
   plot(1:10, 10:1, pch=16 )
   dev.off()

Inkscape的屏幕截图

Screenshot from Inkscape

?pdf中有一个很长的注释",说明R的作者为何认为某些pdf查看器(显然是Inkscape就是其中一种)以及一些未在Mac上测试过的配置建议.

There is a long "Note" in ?pdf about why the authors of R think some pdf viewers (apparently Inkscape being one such) are failing and some configuration suggestions which I have not tested on my Mac.

这篇关于为什么Inkscape无法正确读取R生成的PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆