title: Custom cmap with levels and colors array
body: <p>I am trying to create a custom cmap for use in Python 3.5 using an array of levels and an array of colors. </p>
  
  <p>The levels array is: levels = <code>[-4, 0 ,0, .25, 1, 1.5, 2, 3, 4, 5, 6, 8]</code></p>
  
  <p>and the colors are: </p>
  
  <pre><code>colors=[
  (0,0,0),
  (.8627,.8627, .8627),
  (.5569,.4745,.7098),
  (.0392,.0392, .6078),
  (.2667,.9725,.8314),
  (.3529,.8667,.3843),
  (1,1,.3922),
  (.8627,.0392,.0196),
  (.6863,0,0),
  (.9412, .4706,.7059),
  (1,1,1),
      (.5686,.1765,.5882)  
      ]
  </code></pre>
  
  <p>I've tried using info from this page <a href="https://stackoverflow.com/questions/24997926/making-a-custom-colormap-using-matplotlib-in-python">Making a custom colormap using matplotlib in python</a></p>
  
  <p>and subsequently </p>
  
  <p><code>vmax = 8.0</code></p>
  
  <pre><code>zdr = mpl.colors.LinearSegmentedColormap.from_list('mycmap', [(-4 / vmax, (0,0,0)), (0 / vmax, (.8627,.8627, .8627)), (0 / vmax, (.5569,.4745,.7098)), (.25 / vmax, (.0392,.0392, .6078)), 
                                                 (1 / vmax, (.2667,.9725,.8314)), (1.5 / vmax, (.3529,.8667,.3843)), (2 / vmax, (1,1,.3922)), (3 / vmax, (.8627,.0392,.0196)), 
                                                 (4 / vmax, (.6863,0,0)), (5 / vmax, (.9412, .4706,.7059)), (6 / vmax, (1,1,1)), (8 / vmax, (.5686,.1765,.5882))])
  </code></pre>
  
  <p>but still receive the following error.</p>
  
  <p><code>ValueError: data mapping points must start with x=0. and end with x=1</code></p>
  
  <p>Any help or a point in the right direction would be much appreciated. Thanks!</p>