title: Barplot with deviations from a non zero number
body: <p>I have measurements of some variable. All values are positive. In a barchart I want to show all measurements and the deviation of all measurements from the overall mean. Some bars thus go up from the mean and some go down. In order to get such a graph i tried using <code>offset</code> from the <code>barplot</code> function but that does not work. I found a solution but it is not ideal and prone to mistakes. Applying axes requires some tweaking of the numbers. Is there someone with a more elegant solution to this? Thanks!</p>
  
  <pre><code>(aaa    &lt;-  c(1: 10))
  (meanz  &lt;-  mean(aaa))
  
  (ccc    &lt;-  aaa-meanz[1])
  
  barplot(ccc, axes=FALSE, ylim=c(-5, 5))
  (yvals      &lt;-  c(-5, 0, 5))
  (yvalscorr  &lt;-  yvals+meanz)
  axis(side=2, at=yvals, labels=yvalscorr,    mgp=c(1,1,1),   outer=TRUE, lwd=2, las=1, cex.axis=1.0,   tck=0.02, hadj=0.5,  padj=0.5, pos=-0.2)
  </code></pre>
  
  <p>This is more or less what i intend to get (though more flexibility with setting axes values at 0 is needed)</p>
  
  <p><img src="https://i.stack.imgur.com/w6ZfK.png" alt="enter image description here"></p>