更改ggplot bar plot中的默认颜色

更改ggplot bar plot中的默认颜色,r,ggplot2,default,color-blindness,R,Ggplot2,Default,Color Blindness,我使用以下代码生成以下绘图: ggplot(CellSite_means, aes(x=CellSite, y=MYCA, fill=Cell)) + geom_col() + theme(axis.text.x = element_text(angle=90)) 但是默认的蓝色方案太微妙了。相反,我希望每个单元格有更广泛的颜色(单元格编号,每个单元格内都有a和B位置)。我最好使用色盲调色板。更好的是,我希望色盲调色板成为所有GGPlot的默认调色板。 我试着使用下面的 cbPalette

我使用以下代码生成以下绘图:

ggplot(CellSite_means, aes(x=CellSite, y=MYCA, fill=Cell)) + geom_col() + theme(axis.text.x = element_text(angle=90))

但是默认的蓝色方案太微妙了。相反,我希望每个单元格有更广泛的颜色(单元格编号,每个单元格内都有a和B位置)。我最好使用色盲调色板。更好的是,我希望色盲调色板成为所有GGPlot的默认调色板。 我试着使用下面的

cbPalette <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
ggplot(CellSite_means, aes(x=CellSite, y=MYCA, fill=Cell)) + geom_col() + theme(axis.text.x = element_text(angle=90)) + scale_fill_manual(name="Cell",values=setnames(cbPalette, 1:6)) and a bunch of other iterations and palettes, but can't make it change. 

cbpalete您可以在全局选项中设置ggplot2的默认颜色比例。下面的例子

库(ggplot2)

cbPalette如果您创建一个小的可复制示例以及预期的输出,将更容易提供帮助。了解。