我正在为我的学校项目做这个图表,我必须把隐孢子虫这个名字用斜体印出来。有人知道如何把这个名字垂直向下移动吗?
的数据
编辑,我忘记添加代码,对不起
library(ggplot2)
v_pub <- 6 #CSPV1
v_gs <- 145 #CSPV1
pub <- 4858 #criptosporidium parvum
gs <- 69300 #criptosporidium parvum
vt_pub <- 0 #CSPV1 and TLR3
vt_gs <- 11 #CSPV1 and TLR3
#### GRAPH 1 ####
names <- c(rep("crypto",2), rep("kvirus",2), rep("TLR3",2))
source <- c(rep(c("pub","gs"),3))
numbers <- c(pub, gs, v_pub, v_gs, vt_pub, vt_gs)
df <- data.frame(names, source, numbers)
myplot <- ggplot(df, aes(names, numbers, fill=source)) +
geom_bar(stat = "identity", position = 'dodge') +
xlab("Exact words searched for") + ylab("Number of papers") +
theme_bw() +
#theme(panel.background = element_blank()) +
scale_fill_discrete(name="Database",
breaks=c("gs", "pub"),
labels=c("Google Scholar", "PubMed")) +
geom_text(aes(label = numbers, group=source), position=position_dodge(width=0.9), vjust=-0.2, size=4) +
scale_x_discrete(breaks = c("crypto","kvirus","TLR3"),
labels = c(expression(italic("Criptosporidium \nparvum")),"CSPV1","CSPV1 TLR3"))
myplot
字符串
1条答案
按热度按时间i86rm4rw1#
您可以使用固定的x轴绘制相同的图,如下所示:
字符串
的数据