title: Setting colors range in colorbar Matplotlib
body: <p>I have sets of images which represent rainfall intensity. I need to simply plot them with colorbar() in a discretized color. I found some other answers, but I could not find them exactly similar.
  My problem is that I have to set color ranges according to the given rainfall intensity ranges.</p>
  
  <p><strong>How to set colors based on given values in colorbar?</strong>  One example for one image was shown below:</p>
  
  <pre><code>No  | Color         |  Rain rate
  ------------------------------ 
  0   |  Not visible  | Under 0.2
  1   |  Off-white    | 0.3 - 0.5
  2   |  Sky-blue     | 0.6 - 1.5
  3   |  Light Blue   | 1.6 - 2.5
  4   |  Blue         | 2.6 - 4
  5   |  Light Cyan   | 5 - 6
  6   |  Cyan         | 7 - 10
  7   |  Dark Cyan    | 11 - 15
  8   |  Yellow       | 16 - 35 
  9   |  Yellow-orange| 36 - 50
  10  |  Orange       | 51 - 80
  11  |  Orange-red   | 81 - 100
  12  |  Red          | 100 - 120
  13  |  Dark Red     | 120 - 200
  14  |  Maroon       | 200 - 350
  15  |  Dark Brown   | over 350
  </code></pre>