We're still working on the customisation of the Structure plot.
In the meantime, you could use the code below.
devtools::install_github("EricArcher/strataG")
library(strataG)
library(dartR)
bc <-
bandicoot.gl[,1:100]
sr <- gl.run.structure(bc, k.range = 2:5, num.k.rep = 3, exec = './structure.exe')
ev <- gl.evanno(sr)
qmat <- gl.plot.structure(sr, k=3, CLUMPP="./")
qmat_plot_tmp <- qmat
# preparing data
qmat_plot_tmp$ID <- paste0(qmat_plot_tmp$orig.pop,"_",qmat_plot_tmp$id)
qmat_plot_tmp <- qmat_plot_tmp[,-c(1:3)]
qmat_plot <- reshape2::melt(qmat_plot_tmp,id="ID")
#ordering data
qmat_plot <- qmat_plot[order(qmat_plot$ID),]
#plot
ggplot(qmat_plot, aes(x=ID, y=value, fill=variable))+
geom_col(color="black") +
theme_classic() +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)) +
ylab("Ancestry proportion") +
xlab("") +
labs(fill = "K")