library(RColorBrewer)
library(scales)
library(ggplot2)
library(tidyverse)
## 自定义
tiktok1 <- c('#6667AB', '#181D92', '#EB5C20', '#800020', '#81D8D0', '#B05923', '#8F4B28',
'#1A5599', '#0095B6', '#4C0009', '#003153', '#6495ED', '#969B9E', '#008F8E',
'#F2D88F', '#4A7A6E')
image(x = 1:length(tiktok1), y = 1, z = as.matrix(1:length(tiktok1)) ,col = tiktok1)
show_col(tiktok1)
## RColorBrewer
display.brewer.all()
set3_5 <- brewer.pal(5,"Set3")
## Draw
barplot(c(1:6),col = set3_5)
barplot(c(1:6), col = tiktok1)
ggplot(mpg, aes(fl))+ geom_bar(aes(fill = fl)) + scale_fill_manual(values = tiktok1)
### same
#count <- count(mtcars, gear)
ggplot(count, aes(x=gear,y=n)) + geom_col(aes(fill = gear))
R 选色示例
最新推荐文章于 2023-08-25 00:31:04 发布