title: Columns with same colors using barplot() in R
body: <p>I have some problems with colors in my barplot. I have a 4x4 matrix "allmat":</p>
  
  <pre><code>          A             B           C         D
  L   0.10260     0.0215700   3.017e-01   0.06917
  
  F   0.09840     0.0206900   2.009e-01   0.11450
  
  M   0.14100     0.0065630   3.252e-01   0.35050
  
  G   0.02121     0.0006811   5.454e-06   0.13810
  </code></pre>
  
  <p>To plot the columns in one graph I use:</p>
  
  <pre><code>mp&lt;-barplot(allmat,beside=T,axisnames=F,col=c("red","black","green","blue"))
  mtext(1,at=mp,text=c("L","F","M","G"),line=0,cex=0.5)
  mtext(1,at=colMeans(mp),text=c("A","B","C","D"),line=2)
  </code></pre>
  
  <p>What I get is that every row has the same color, but I want the columns be of the same color. How do I do that?</p>
  
  <p>Best,</p>
  
  <p>Eugen</p>