title: Colorplot that distinguishes between positive and negative values
body: <p>As one can see in this sample code since 0 is somewhere in the spectrum it is hard to trace which points are negative and which are positive. Although my real plot is more contiguous I wonder if there is a way to seperate negative and postivie values in these clorplots; for example how can I use two different spectrum of colours for positive and negative values.</p>
  
  <pre><code>import numpy as np
  from matplotlib import pyplot as plt
  a=np.random.randn(2500).reshape((50,50))
  plt.imshow(a,interpolation='none')
  plt.colorbar()
  plt.show()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/PQwOz.png" alt="enter image description here"></p>
  
  <p><strong>EDIT</strong>
  With the help of @MultiVAC and looking for solutions I came across <a href="https://stackoverflow.com/questions/14777066/matplotlib-discrete-colorbar">this</a>.</p>
  
  <pre><code>import numpy as np
  from matplotlib import pyplot as plt
  from matplotlib.colors import BoundaryNorm
  a=np.random.randn(2500).reshape((50,50))
  
  # define the colormap
  cmap = plt.cm.jet
  # extract all colors from the .jet map
  cmaplist = [cmap(i) for i in range(cmap.N)]
  # create the new map
  cmap = cmap.from_list('Custom cmap', cmaplist, cmap.N)
  
  # define the bins and normalize
  bounds = np.linspace(np.min(a),np.max(a),5)
  norm = BoundaryNorm(bounds, cmap.N)
  
  plt.imshow(a,interpolation='none',norm=norm,cmap=cmap)
  plt.colorbar()
  plt.show()
  </code></pre>
  
  <p>Still I don't know how to differentiate zero!</p>
  
  <p><img src="https://i.stack.imgur.com/s83hd.png" alt="enter image description here"></p>