ggplot 颜色手动填充
scale_colour_manual(values = myCoulour.plannet )
从色卡提取颜色
library(png);library(RImagePalette)
picture <- readPNG("colormap.png")
col.51 <- image_palette(picture,n=51)
colormap.png
R作图配色---颜色提取及色彩搭配_TS的美梦的博客-CSDN博客_r语言绘图颜色
小离散色色盘
高对比度10色:yarrr::piratepal(palette = "yarrr_1")
library(RColorBrewer)
brewer.pal(n=12,name = "Paired") ### 12 色
brewer.pal(n=12,name = "Dark2") ### 8 色
brewer.pal(n=12,name = "Set1") ### 9 色
30离散色色盘-低对比度
scales::show_col(colour.30.maps)
library(RColorBrewer)
colour.30.maps <- c(brewer.pal(9,"Set1")[c(1:5,7,6,8,9)],brewer.pal(9,"Pastel1")[c(7,2,3,5,1)],brewer.pal(12,"Set3")[c(-2,-4,-6,-9,-11)],brewer.pal(8,"Set2")[c(3,4,7)],brewer.pal(8,"Pastel2")[8],brewer.pal(12,"Paired")[c(5,6,9,10,12)])
51离散色色盘-底对比度
scales::show_col(colour.51.maps)
colour.51.maps <- c("#DEC44B","#BBC077","#F48E8D","#C286AA","#D08F56",
"#B59679","#CD7C3F","#DA5F32","#93CB2B","#51A729",
"#8A0133","#61186F","#E43C89","#F1756C","#C66F69",
"#ED1318","#B32820","#E6DCAB","#B9D1B1","#848485",
"#5E7780","#D69CB0","#AEADB0","#F5EEE9","#D3D8D9",
"#94C6D3","#99AFAD","#755F45","#783F0C","#865A9A",
"#7B1B79","#6DB8D3","#48AB95","#DD9316","#ED550A",
"#9AD092","#562819","#EDD684","#778863","#1673CA",
"#176496","#3F6C8D","#EDA962","#40987D","#8EB481",
"#CA4146","#2C1020","#1A4A4E","#337F3D","#041514","#FFFFFE")
渐变色色盘
viridis::mako(100)
viridis::magma(100)
viridis::viridis(200)
yellow_red = circlize::colorRamp2(quantile(m)+0.1, c("white","cornflowerblue","grey","yellow","red"))
rainbow(5)
ggplot2 colors : How to change colors automatically and manually? - Easy Guides - Wiki - STHDA
网友评论