title: Matlab Bar Graph - fill bars with different colours depending on sign and magnitude
body: <p>I am tring to shade the individual bars in a bar graph different colours, say blue for positive red for negative. I cannot find aything on the internet that works. I my code below I find every bar is coloured as per the value of the first bar, rather than separate colours for each bar:</p>
  
  <pre><code>c1=zeros(32,3);
  c2=zeros(32,3);
  for i=1:3
      c1(:,i) = linspace(r(i),w(i),32);
      c2(:,i) = linspace(w(i),b(i),32);
  end
  c= [c1(1:end-1,:);c2];
  subplot(2,2,2)
  
  bar(Numbers(end-7:end,1)), shading interp
  caxis([-8 8]), colormap(c), colorbar
  </code></pre>
  
  <p>Thanks for your help</p>