Rstudio pdf export imported in Inkscape [duplicate

2019-07-23 18:11发布

This question already has an answer here:

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条回答
Summer. ? 凉城
2楼-- · 2019-07-23 18:40

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

查看更多
登录 后发表回答