title: Partially color histogram in R
body: <p><img src="https://i.stack.imgur.com/oheXo.png" alt="enter image description here"></p>
  
  <p>I have a histogram as shown in the picture. I want the bars in the two regions to be coloured red and green respectively, i.e., the bars from 0 to the first black border on the left should be coloured red and the bars in the second region should be coloured green.
  Can this be done in R? 
  The code used to get the histogram is</p>
  
  <pre><code>hist(pr4$x[pr4$x[,1]&gt;-2,1],breaks=100)
  </code></pre>