Why doesn't Inkscape correctly read PDF files generated by R?

落爺英雄遲暮 提交于 2019-11-28 04:44:08

问题


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?


回答1:


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()

Screenshot from Inkscape

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.



来源:https://stackoverflow.com/questions/23524262/why-doesnt-inkscape-correctly-read-pdf-files-generated-by-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!