title: add white color to pylab colorbar default colormap
body: <p>Hi I have the following code:</p>
  
  <pre><code>rateMap, occMap, spikeMap = pickle.load(open(rateMapFileName))
  
  pl.imshow(rateMap)
  pl.colorbar()
  </code></pre>
  
  <p>Now occMap is the occupancy map containing x,y position at multiple timestamps. There are some points x,y locations which have no occupancy (i.e. = 0 value at that matrix value)</p>
  
  <p>When I plot rateMap(which is  = spikeMap/occMap) using the script above. The colorbar that is generated uses default <em>jetmap</em> colormap. I want the null/0 values from <em>occMap</em> to appear as <em>white</em> in the rateMap plot. So anyway to add zero to colorbar function? and also relating it with the occMap</p>
  
  <p>I tried looking at this script <a href="https://stackoverflow.com/questions/36008634/how-to-add-black-to-matplotlib-colormap">How to add &quot;black&quot; to matplotlib colormap?</a> but couldn't get it to work? </p>
  
  <p>Here is an example image which has white spots basically referring to the x,y location with 0 value or no occupancy: </p>
  
  <p><a href="https://i.stack.imgur.com/9y8LG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9y8LG.png" alt="enter image description here"></a></p>
  
  <p>*****EDIT****
  I tried playing around with the code, here is how I was added white color to the colormap but I want to add this white color to default jet colormap. Any suggestions??</p>
  
  <pre><code>cmap = LinearSegmentedColormap.from_list('mycmap', ['white', 'blue', 'cyan', 'green', 'yellow','red'])
  fig, ax = plt.subplots()
  im = ax.imshow(im, cmap=cmap, interpolation='nearest')
  fig.colorbar(im)
  plt.show()
  </code></pre>