看到朋友圈有人轉發了一個視頻
image.png
然后找到這個up主的主頁來看了下,其中有四個視頻是國潮頂級配色,還有一個視頻是世界經典配色,個人覺得還挺好看的,保存下來作為R語言科研數據可視化中的配色備選方案,這里只保存視頻封面的配色,視頻里還提供了很多兩兩搭配的配色,這個有點多,有時間了再抽空整理
世界經典配色
image.png
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)
image.png
國潮頂級配色之一
image.png
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)
image.png
這里兩個紅稍微有點重復
國潮頂級配色之二
image.png
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)
image.png
國潮頂級配色之三
image.png
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)
image.png
國潮頂級配色之四
image.png
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)
image.png
拼圖
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)
image.png
歡迎大家關注我的公眾號
小明的數據分析筆記本
小明的數據分析筆記本 公眾號 主要分享:1、R語言和python做數據分析和數據可視化的簡單小例子;2、園藝植物相關轉錄組學、基因組學、群體遺傳學文獻閱讀筆記;3、生物信息學入門學習資料及自己的學習筆記!