I currently have a stacked barplot with the data how I want it, other than the fact I am unsure of how to add percentage labels to break down how much of each sample belongs to each color/category.
I just need to know what packages/code would be helpful in adding the percentages so I can see the specific breakdown of the last two columns in particular.
I have the following code and plot:
tbl10 = read.table("combinedtest.Q")
names1 = read.table("names_sorted.txt")[,1]
bp=barplot(t(as.matrix(tbl10)), col=c("aliceblue","antiquewhite","aquamarine","black","blue","blue4","blueviolet","brown1","brown4","cadetblue","chartreuse","chocolate1","coral1","cornflowerblue","cyan","darkgoldenrod1","darkgray","darkgreen","darkmagenta","darkolivegreen1","hotpink","darkseagreen2","darkslateblue","deeppink","firebrick1","khaki1"),xlab="", ylab="Ancestry", border=NA)
text(cex=1, x=bp, y=-.08, names1, xpd=TRUE, srt=90)