Code for Curve Fitting library(readxl) library(ggplot2) library(ggpmisc) y <- read_excel("diversity.xlsx",sheet = "Sheet1") ggplot(data=y,ase(x=x2,y=a))+geom_point(shape=20,size=3)+theme_bw()+theme(panel.grid=elment_blank())+geom_smooth(method="lm",formula=y~x+I(x^2),fullrange=T)+stat_poly_eq(formula=y~x+I(x^2),parse=TRUE,aes(label=paste(after_stat(eq.label),after_stat(rr.label),after_stat(p.value,label),sep="*\"\"*")),label.y="top",label.x="right")+xlab("Grazing instensity(sheep·hm-2)") +ylab("α diversity index")+theme(axis.title=element_text(size=12,face="bold"))+scale_x_continuous(breaks=c(1,2,3,4,5),labels=c("CK","LG","MG","HG","EG")) Code for Bar Chart library(readxl) library(ggplot2) library(ggsignif) x <- read_excel("α diversity.xlsx",sheet = "Sheet1") ggplot(data=x,ase(x=cd,y=a1))+stat_summary(geom="errorbar",fun.min=min,fun.max=max,width=0.2,size=0.5)+stat_summary(geom="bar",fun=mean,width=0.5,size=0.5,aes(fill=cd))+scale_fill_manual(values=c("#E0F3DB","#B5E6D4","#A8DDB5","#4EB3D3","#0868AC"))+scale_y_continuous(expand = c(0,0),limits = c(0,4))+theme_bw()+theme(panel.grid = element_blank())+labs(x="Grazing intensity",y="α diversity index of dominant species")+theme(axis.title=element_text(size=12,color="black"),axis.text=element_text(size = 10,color = "black")) Code for Percentage Stacked Bar Chart library(readxl) library(ggplot2) y <- read_excel("α diversity.xlsx",sheet = "Sheet1") ggplot(data=y,aes(x=x2,y=PD,fill=WZ))+geom_bar(stat="identity",position="fill",color="black",width=0.7,size=0.25)+scale_fill_manual(values = c("#F6DDC5","#EEB282","#E29C35","#E57D3C","#C64D1D","#8A3122"))+theme_test()+theme(axis.title=element_text(size=12,color="black"),axis.text=element_text(size = 10,color = "black"),legend.title=element_text(size = 12,color = "black"),legend.text=element_text(size = 10,color = "black"),legend.background = element_blank(),legend.position = "bottom")+labs(x="Grazing intensity(sheep·hm⁻²)",y= "Frequency of common species")+guides(fill=guide_legend(title = "")) Code for Correspondence Analysis library(readxl) library(FactoMineR) library(CA) x=read_excel() y=data.frame(x) rownames(y)=y$cd z=y[-1] rea.ca=CA(z)