library(ggplot2)
cols01<-c("#f49128","#194a55","#187c65","#f26115","#c29f62","#83ba9e")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols01)+
geom_text(aes(label=cols01,x=5),color="white",size=8)
cols02<-c("#c62d17","#023f75","#ea894e","#266b69","#eb4601","#f6c619")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols02)+
geom_text(aes(label=cols02,x=5),color="white",size=8)
cols03<-c("#fa6e01","#2f2f2f","#972b1d","#e6a84b","#4c211b","#ff717f")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols03)+
geom_text(aes(label=cols03,x=5),color="white",size=8)
cols04<-c("#223e9c","#b12b23","#aebea6","#edae11","#0f6657","#c74732")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols04)+
geom_text(aes(label=cols04,x=5),color="white",size=8)
cols05<-c("#6a73cf","#edd064","#0eb0c8","#f2ccac","#a1d5b9","#e1abbc")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols05)+
geom_text(aes(label=cols05,x=5),color="white",size=8)
library(ggplot2)
cols01<-c("#f49128","#194a55","#187c65","#f26115","#c29f62","#83ba9e")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols01)+
geom_text(aes(label=cols01,x=5),color="white",size=8) -> p1
cols02<-c("#c62d17","#023f75","#ea894e","#266b69","#eb4601","#f6c619")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols02)+
geom_text(aes(label=cols02,x=5),color="white",size=8) -> p2
cols03<-c("#fa6e01","#2f2f2f","#972b1d","#e6a84b","#4c211b","#ff717f")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols03)+
geom_text(aes(label=cols03,x=5),color="white",size=8) -> p3
cols04<-c("#223e9c","#b12b23","#aebea6","#edae11","#0f6657","#c74732")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols04)+
geom_text(aes(label=cols04,x=5),color="white",size=8) -> p4
cols05<-c("#6a73cf","#edd064","#0eb0c8","#f2ccac","#a1d5b9","#e1abbc")
ggplot(data = data.frame(y=letters[1:6],
x=10),
aes(x=x,y=y))+
geom_col(aes(fill=y),show.legend = FALSE)+
scale_fill_manual(values = cols05)+
geom_text(aes(label=cols05,x=5),color="white",size=8) -> p5
library(patchwork)
p1+theme_void()+
p2+theme_void()+
p3+theme_void()+
p4+theme_void()+
p5+theme_void()+
plot_layout(nrow = 1)
特别申明:本文为转载文章,转载自Punicagranatum 小明的数据分析笔记本,不代表贪吃的夜猫子立场,如若转载,请注明出处:https://mp.weixin.qq.com/s/Kt1wT5p9r2nxWEI0vWmwuw