期刊要我将这些数字作为EPS文件提交。使用ggplot2从R导出它们作为EPS文件然后在Adobe Illustrator中打开EPS文件告诉我“在系统上找不到字体”。
我该如何解决这个问题?这是我目前使用的语法。
library(ggplot2)
a <-c("Sad Mood", "Cognition", "Fatigue", "Interest Loss", "Slowed", "Self-blame", "Suicidal Ideation", "Early insomnia", "Appetite", "Late insomnia", "Agitated", "Weight", "Middle insomnia", "Hypersomnia", "Age", "Sex")
b <-c(20.7,16.5,13.8,13.1,8.8,6.4,6.1,3.6,3.0,2.5,2.1,1.3,0.9,0.7,0.4,0.1)
c <-c(17.90,13.64,11.36,10.72,6.99,4.60,4.68,2.38,2.09,1.65,1.35,0.76,0.47,0.24,0.15,0.03) #lower CI
d <-c(23.47,19.27,16.28,15.74,10.64,8.20,7.95,5.07,4.21,3.63,2.99,2.22,1.59,1.62,0.95,0.31) #upper CI
data <- data.frame(a,b,c,d)
data1 <- transform(data, a = reorder(a, order(b, decreasing = FALSE)))
data1$label <-sprintf("%.1f", data1$b)
ggplot(data1, aes(x=as.factor(a), y=b, order=a))+
geom_bar(stat="identity",fill='#888888',colour='#888888') +theme_bw() +coord_flip() +
ylab("Relative importance estimation in %") +xlab("") +
geom_errorbar(aes(ymin=c, ymax=d), width=.3, size=.5)+
geom_text(aes(label=label), size=4.5, vjust=.4,hjust=-1.5)+
scale_y_continuous(limits = c(-0, 25))+
theme(axis.text.x = element_text(size = 13))+
theme(axis.text.y = element_text(size = 13))+
theme(axis.title.x = element_text(size = 14, vjust=-.2))