在R中导出为SVG时保持斜体

在R中导出为SVG时保持斜体,r,svg,plot,ggplot2,inkscape,R,Svg,Plot,Ggplot2,Inkscape,我正在尝试将图形作为SVG从R导出到Inkscape(我使用的是RStudio 0.98.1102和R版本3.1.2)。这是我的剧本 library(ggplot2) Gene<-c("Gene1","Gene2","Gene1","Gene2") count1<-c(12,14,16,34) count2<-c(4,7,9,23) count3<-c(36,22,54,12) count4<-c(12,24,35,23) Species<-c("A","A

我正在尝试将图形作为SVG从R导出到Inkscape(我使用的是RStudio 0.98.1102和R版本3.1.2)。这是我的剧本

library(ggplot2)

Gene<-c("Gene1","Gene2","Gene1","Gene2")
count1<-c(12,14,16,34)
count2<-c(4,7,9,23)
count3<-c(36,22,54,12)
count4<-c(12,24,35,23)
Species<-c("A","A","B","B")
df<-data.frame(Gene,count1,count2,count3,count4,Species)

cols = c(2,3,4,5)
df1  = transform(df, mean=rowMeans(df[cols]), sd=apply(df[cols],1, sd))

# df1 looks like this
#   Gene count1 count2 count3 count4 Species  mean        sd
#1 Gene1     12      4     36     12       A 16.00 13.856406
#2 Gene2     14      7     22     24       A 16.75  7.804913
#3 Gene1     16      9     54     35       B 28.50 20.240224
#4 Gene2     34     23     12     23       B 23.00  8.981462

ggplot(df1, aes(x=as.factor(Gene), y=mean, fill=Species)) +
  geom_bar(position=position_dodge(), stat="identity", colour='black') +
  geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=.2,position=position_dodge(.9)) + 
  theme(axis.text.x  = element_text(angle=90, vjust=0.8, size=14, colour="black",face="italic")
库(ggplot2)

Gene也许可以试试gridSVGpackage@baptiste嗯。。。我刚刚尝试了它(在我的脚本末尾添加
grid.export(“example.svg”)
),它确实适用于字体,但我现在没有正确地获得错误条!也许我应该尝试另一个gridSVG函数,或者用另一个软件包绘制绘图?我可以通过
ggsave
在Firefox中打开,获得正确的输出,但Illustrator中的输出看起来很混乱。也许Inkscape没有正确解释斜体。