为ggthemes中的scale_COLOR_COLORBIND()选择颜色
我想从ggthemes中选择colorblind_pal的特定颜色 这项工作:为ggthemes中的scale_COLOR_COLORBIND()选择颜色,r,ggplot2,color-blindness,ggthemes,R,Ggplot2,Color Blindness,Ggthemes,我想从ggthemes中选择colorblind_pal的特定颜色 这项工作: library(ggplot2) library(ggthemes) p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg, colour = factor(gear))) + facet_wrap(~am) p + theme_igray() + scale_colour_color
library(ggplot2)
library(ggthemes)
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
colour = factor(gear))) + facet_wrap(~am)
p + theme_igray() + scale_colour_colorblind()
因为您已经有了颜色,所以可以使用“缩放颜色”手册:
因为您已经有了颜色,所以可以使用“缩放颜色”手册: 为了手动指定要使用的颜色,可以使用scale\u color\u manual:
library(ggplot2)
library(ggthemes)
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_igray() +
scale_color_manual(values = c("#000000","#F0E442","#D55E00"))
p
为了手动指定要使用的颜色,可以使用scale\u color\u manual:
library(ggplot2)
library(ggthemes)
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_igray() +
scale_color_manual(values = c("#000000","#F0E442","#D55E00"))
p
library(ggplot2)
library(ggthemes)
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_igray() +
scale_color_manual(values = c("#000000","#F0E442","#D55E00"))
p