Plot!
library(ggplot2)
library(ggpubr)
# 设置颜色
library(RColorBrewer)
mycolors <- colorRampPalette(c("#A6CEE3", "#1F78B4", "#B2DF8A", "#33A02C", "#FB9A99", "#E31A1C", "#FDBF6F", "#FF7F00", "#CAB2D6", "#6A3D9A", "#B15928" ))(11)
p1 <- ggplot(data,aes(x=Elements,y=`average-PS`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) + labs(x=NULL,y='Metal concentration (ppb)',fill=NULL) + #可自定义标签名字
coord_cartesian(ylim = c(0,5)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16))
p1

p2 = ggplot(data,aes(x=Elements,y=`average-PS`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) + labs(x=NULL,y=NULL,fill=NULL)+ #可自定义标签名字
coord_cartesian(ylim = c(140,160)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16), axis.text.x = element_blank(), axis.ticks.x = element_blank()) + scale_y_continuous(breaks = c(140,160))
p2

p3 = ggplot(data,aes(x=Elements,y=`average-H-PP`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) +
labs(x=NULL,y='Metal concentration (ppb)',fill=NULL)+ #可自定义标签名字
coord_cartesian(ylim = c(0,5)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16))
p3

p4 = ggplot(data,aes(x=Elements,y=`average-H-PP`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) +
labs(x=NULL,y=NULL,fill=NULL)+ #可自定义标签名字
coord_cartesian(ylim = c(7,16)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16), axis.text.x = element_blank(), axis.ticks.x = element_blank()) + scale_y_continuous(breaks = c(7,16))
p4

p5 = ggplot(data,aes(x=Elements,y=`average-S-PP`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) +
labs(x=NULL,y='Metal concentration (ppb)',fill=NULL)+ #可自定义标签名字
coord_cartesian(ylim = c(0,5)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16))
p5

p6 = ggplot(data,aes(x=Elements,y=`average-S-PP`,fill=Elements)) + geom_bar(stat='identity',position=position_dodge()) +
labs(x=NULL,y=NULL,fill=NULL)+ #可自定义标签名字
coord_cartesian(ylim = c(20,110)) + scale_fill_manual(values = mycolors) + theme(axis.text = element_text(colour = 'black', size = 14), axis.ticks = element_line(colour = 'black', size = 0.6), axis.ticks.length = unit(1.2, 'mm')) + theme(legend.position = 'none', axis.title.y = element_text(size = 16), axis.text.x = element_blank(), axis.ticks.x = element_blank()) + scale_y_continuous(breaks = c(20, 110))
p6
