I am trying to plot some STRUCTURE-like results from ADMIXTURE. I got some code from one of my adviser's collaborators to plot my results, but I am having problems.
I have noticed that R will randomly make certain individual bars double width and other bars zero width (i.e., some samples will fail to appear and simultaneously others will be double). There are 2033 individuals in the dataset from 161 populations (=160 separating bars). The double bars will often crossover population separating bars. I have been trying to tinker with the output resolution, but nothing seems to fix the issue.
Is there anyway to set the area of the barplot itself (excluding the axes and the margin area) and fix the width of the bars themselves? If each bar is locked to one pixel wide, but the barplot itself should only be 2193 pixels wide.
Since it is not my code, I don't want to post it, but here are few lines of code that are particularly relevant
Part of the structure.plot function definition
barplot(t(as.matrix(q)), space=0, border=NA, col=cols, axes=F, axisnames=F)
Final plot generation
tiff(file="structure-plot-3000.tiff", width=3000, height=500, antialias="default")
structure.plot(qdata, cex.axis=.8)
Thanks!
This sounds more of a StackOverflow question but if you add some more info like a snapshot of your data, in this case I believe it's "q", that can be used to reproduce your error/problem, you might be able to get some more help.
The input data form is as such
(Q3-Q12 columns omitted, values are not all zero). Other parts of the code, sort the qdata input based on the order in another list and based on the magnitude of data values (within populations).
Here is the definition of the structure.plot function
Anyone have any suggestions?