谁能告诉我如何调整x标签位置?
我想把标签(df1 $ Value)放在每个酒吧的头上?
谢谢你的帮助!
Here is my code
Yr <- c("2016","2017","2016","2017","2016","2017")
Type <- c("A","A","B","B","C","C")
Value <- c(73,183,160,476,11,73)
p1Data <- data.frame(Yr,Type,Value)
p1Data$Yr <- as.character(p1Data$Yr)
p1Data <- transform(p1Data, Type = factor(p1Data$Type, levels = c("A","B","C")))
library(ggplot2)
p1 <- ggplot(p1Data,aes(Type,Value,fill=Yr))+geom_bar(stat="identity",position='dodge')+ theme(axis.title.x=element_blank())+ geom_text(aes(label=Value,vjust=1.5))
答案 0 :(得分:0)