为什么在以下代码中,颜色不会像在fivethirtyeight主题中那样改变?
ggplot(df.long, aes(ROIs, Mean, fill=Methods))+
geom_bar(stat="identity",position="dodge", width=0.75)+
theme_fivethirtyeight()+
scale_color_fivethirtyeight()+
theme(axis.text.x=element_text(angle=20,hjust=1,vjust=1, face="bold", size=9),
axis.text =element_text(face="bold"),
axis.title= element_text(face="bold"),
legend.position=c(1,1),
legend.justification = c(1, 1))
答案 0 :(得分:0)
如何使用scale_fill_fivethirtyeight()
代替scale_color_fivethirtyeight()
?
mtcars$am <- as.factor(mtcars$am)
ggplot(mtcars, aes(cyl, mpg, fill=am))+
geom_bar(stat="identity",position="dodge", width=0.75)+
theme_fivethirtyeight()+
theme(axis.text.x=element_text(angle=20,hjust=1,vjust=1, face="bold", size=9),
axis.text =element_text(face="bold"),
axis.title= element_text(face="bold"),
legend.position=c(1,1),
legend.justification = c(1, 1)) +
scale_fill_fivethirtyeight()