我正在制作以下挑战:
library(ggplot2)
library(ggthemes)
library(RColorBrewer)
library(reshape2)
ggplot(tips, aes(x = day, y = total_bill, fill=sex)) + #grouping factor, y variable
geom_boxplot(position = position_dodge(width = 1.2)) + # how to color
labs(title ='Barchart Plot', x=' xaxis label',y='ylabel') +
scale_fill_brewer(palette="Dark2")+ #use Dark2, Paired, Set1
theme(axis.text.x = element_text(colour="black",size=14,angle=45,
hjust=.5,vjust=.5,face="bold"),
axis.text.y = element_text(colour="grey20",size=16,angle=45,
hjust=1,vjust=0,face="plain"),
axis.title.x = element_text(colour="grey20",size=12,angle=45,
hjust=.5,vjust=0,face="plain"),
axis.title.y = element_text(colour="blue",size=16,angle=90,
hjust=0.5,vjust=.5,face='bold')) +
stat_summary(fun.y=mean, geom="point", shape=17, size=4) +
theme_base() +
geom_text(label='just the mean or median please - number only')