ggplot(data = rate,aes(x=reorder(地区,地区生产总值.)))+
geom_bar(aes(y=地区生产总值.,fill=地区),stat = "identity")+
labs(title = "2015年山东各地市生产总值及占比情况")+
geom_text(aes(label=rate$地区生产总值.,y=地区生产总值.-500))+
geom_text(aes(label=b,y=地区生产总值.+600))+
coord_flip()+
xlab("地区")+ylab("地区生产总值(亿元)")+
scale_y_continuous(limits = c(0,10000),breaks = seq(0,10000,2500))+
theme_minimal()+theme(legend.position = "none")
R语言ggplot2 柱状图(条形图)xy轴翻转,及排序
最新推荐文章于 2025-01-04 08:52:44 发布