ggplot2之图例修改

1.修改图例名称
labs(fill="name")
2.隐藏图例标题
theme(legend.title=element_blank()
3.修改图例顺序
scale_color_discrete(limits=c("a","d","c"))
4.不加legend
+theme(legend.position = "none")
5.删除legend.title
theme(legend.title = element_blank())
6.修改legend的位置
theme(legend.position = "left")#(right,top,bottom)
7.修改尺寸大小
theme(legend.text = element_text(colour = "red",angle=45,size=10,hjust=3,vjust=3,face="bold"))

8.颜色的修改及一致性
geom_bar(position = "stack",aes(order=desc(name)))
 

你可能感兴趣的:(R语言)