Rstudio pdf export imported in Inkscape [duplicate]

孤街醉人 提交于 2019-12-24 17:47:59

问题


I'm trying to export pdf of ggplot-generated figures for post-processing in Inkscape using various methods: ggsave(), pdf(), dev.copy2pdf() and Rstudio export via GUI (3x3 size).

library(ggplot2)

df <- data.frame(x = seq(1,10,1),
                 y = seq(1,10,1),
                 y.err = rep(1,10))

p<- ggplot(df, aes(x = x, y = y))+
  geom_errorbar(aes(ymin = y - y.err, ymax = y + y.err))+
  geom_point(size = 3, shape = 21, fill = "white")

ggsave(p, file = "ggsave.pdf", width = 3, height = 3)

pdf(file = "pdf.pdf", width = 3, height = 3)
p
dev.off()

p

dev.copy2pdf(file = "dev.copy2pdf.pdf", width = 3, height = 3)

All pdf files look similar in Adobe Reader with GUI-generated file somewhat bigger (5.2 kb vs. 4.8 kb). Screenshot-1

But when imported to Inkscape, three non-GUI generated plots have circles for data points of smaller radius and misaligned (see Screenshot-2).

Does anybody know what are parameters that I'm missing in pdf export commands to get the same result in the Inkscape import? Thanks

Additional info:

  • OS Windows 10

  • Rstudio 0.99.441

  • R 3.2.4

  • Inkscape 0.91

[update 1] . Updated Rstudio to 0.99.902; R to 3.3.0. Same issue.

[solution] Addition useDingbats = F to any pdf-exporting command solves the issue (taken from Why doesn't Inkscape correctly read PDF files generated by R?)


回答1:


Addition useDingbats = F to any pdf-exporting command solves the issue (taken from Why doesn't Inkscape correctly read PDF files generated by R?)



来源:https://stackoverflow.com/questions/37662120/rstudio-pdf-export-imported-in-inkscape

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