如何为此条形图添加标签?我把传说放进了,但是它出现在文本中。我需要在x轴上添加四个标签,蓝色-Dorper,Dorpersm,绿色 - Namafr和红色-SAMM
colors=c("red","blue","green").
meanQ<-read.table("fastk3.txt", header=T)
#concatenate only last 4 rows of data together
annie<-meanQ[c("SAMM","DORPER", "Namafr")]
jpeg(file="Rplotk3.jpg", bg="white", width=720, height=240, units="px", pointsize=14)
#margins (bottom, left, top, right)
par(mai=c(0.25,1,0.25,0.5))
# Get population information
barplot(t(as.matrix(annie)), width = 1, space = 0, beside = FALSE, col=colors, legend.text = TRUE, args.legend = list (x = "topright")
,xlab = "Genotypes", ylab = "Ancestry" , border = NA, xaxt = "n", offset = 0, axes = TRUE, axisname = TRUE)
dev.off()