Rstudio pdf导出在Inkscape中导入 [英] Rstudio pdf export imported in Inkscape
问题描述
我试图用ggsave(),pdf(),dev.copy2pdf()和Rstudio通过GUI导出(3x3大小)导出ggplot生成的数字在Inkscape中进行后处理。 (b,b,b,b,b,b,b,b,b,b,b, 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.pdf ,width = 3,height = 3)
生成的文件有点大(5.2 kb比4.8 kb)。 截图-1
但是,当导入到Inkscape中时,三个非GUI生成的曲线具有较小半径和未对齐的数据点的圆圈(参见 Screenshot-2 )。
有没有人知道我在pdf导出命令中缺少哪些参数,以便在Inkscape导入中获得相同的结果?谢谢
其他信息:
-
操作系统Windows 10
> -
Rstudio 0.99.441
-
R 3.2.4
-
Inkscape 0.91
<更新1>。更新Rstudio为0.99.902; R到3.3.0。同样的问题。
$ b [解决]添加
useDingbats = F
到任何pdf-exporting命令解决问题为什么Inkscape不能正确阅读PDF由R生成的文件)添加 useDingbats = F
到任何PDF输出命令解决问题(摘自为什么Inkscape不能正确读取由R生成的PDF文件?)
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?)
Addition useDingbats = F
to any pdf-exporting command solves the issue (taken from Why doesn't Inkscape correctly read PDF files generated by R?)
这篇关于Rstudio pdf导出在Inkscape中导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!