我在 R 中使用 plot_bar 函数来说明来自 phyloseq 类的一些数据。我想为我的情节添加一些不同的颜色,这里是 RColorBrewer 包中的配对调色板。由于某些原因,这些条最终仍然具有它们周围的默认颜色。在这里你可以看到它的样子:https : //imgur.com/a/VSBvwtk 有什么办法可以摆脱它们吗?
phylum.both.b <- plot_bar(both.b, fill="phylum") +
geom_bar(aes(color=phylum, fill=phylum), stat="identity") +
scale_y_continuous(expand=c(0,0)) +
labs(x="", y="Relative abundance") +
scale_fill_brewer(palette="Paired") +
theme(axis.text.x=element_blank()) +
facet_wrap(~Type, scale="free_x", ncol=4) +
facet_row(vars(Type), scales = 'free', space = 'free')
ggsave("PhylumBothBact.png", phylum.both.b, height=15, width=40, unit="cm")