title: Python Matplotlib: Create normal colorbar with white interval at specific values
body: <p>I have Sea Ice Concentration data around Antarctica that range between -40 and +40 (see attached Figure) but I would like for the values between +10 and -10 to appear white in my map and colorbar because they do not represent sea ice concentration (they appear light green and light blue in the current Figure).</p>
  
  <p>I do not want to exclude them from my array but rather want to assign them a specific color (in this case, white) and keep the jet colorscale for the other values.</p>
  
  <p><img src="https://i.stack.imgur.com/drKed.png" alt="Map of Sea Ice Anomaly"></p>
  
  <p>I have looked at multiple other questions (i.e. <a href="https://stackoverflow.com/questions/41806285/how-to-change-colorbars-color-in-some-particular-value-interval">How to change colorbar&#39;s color (in some particular value interval)?</a>; <a href="https://stackoverflow.com/questions/11386054/python-matplotlib-change-default-color-for-values-exceeding-colorbar-range">Python matplotlib change default color for values exceeding colorbar range</a>; **<a href="https://stackoverflow.com/questions/42843669/reset-default-matplotlib-colormap-values-after-using-set-under-or-set-over">Reset default matplotlib colormap values after using &#39;set_under&#39; or &#39;set_over&#39;</a>) </p>
  
  <p>but have not managed to apply those to my case. </p>
  
  <p>I have tried to use 'set under','set over', 'set.bad' but have not managed to get what I would like. I have also tried to create my own colormap but haven't been successful either. </p>
  
  <p>Would anyone be able to help?</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>UPDATE: </p>
  
  <p>I have adapted the code from 'stackoverflow.com/a/41815114/5103802' (see Updated Code below) but my colors are not white for values [+10 -10] and 'jet'
  for above +10 and below -10 (see Figure below). The 'tmap' object seems to have messed up the colorscale. Any idea on how I could get the jet colorscale and leave the interval between -10 and +10 white?</p>
  
  <p>Thanks for your help.</p>
  
  <p><a href="https://i.stack.imgur.com/Y67wv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y67wv.png" alt="SIE Anomaly Update"></a></p>
  
  <p>Updated code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.colors
  from mpl_toolkits.basemap import Basemap, cm, rcParams
  
  HIGH_86 = a.variables['high_86'][:]
  
  n=40 
  x = 10 
  
  lower = plt.cm.seismic(np.linspace(1-x, 0, n))
  upper = plt.cm.seismic(np.linspace(0, x, n))
  
  white1 = plt.cm.seismic(np.ones(10)*x)
  white2 = plt.cm.seismic(np.ones(10)*-(x))
  
  
  colors = np.vstack((lower, white1, white2, upper))
  tmap = matplotlib.colors.LinearSegmentedColormap.from_list('terrain_map_white', colors)
  
  x = HIGH_86
  
  lats = a.variables['latitude'][:]
  lons = a.variables['longitude'][:]
  
  lons, lats = np.meshgrid(lons,lats)
  
  fig, ax = plt.subplots()
  
  m2 = Basemap(projection='spstere',boundinglat=-50,lon_0=180,resolution='l')
  
  CS2 = m2.contourf(lons,lats,x,cmap=tmap,latlon=True)
  cbar = m2.colorbar(CS2,location='right', pad="12%")
  
  m2.drawparallels(np.arange(-90.,99.,60.),labels=[False,False,False,False])
  m2.drawmeridians(np.arange(-180.,180.,90.),labels=[True,False,False,True])
  m2.drawcoastlines()
  m1.fillcontinents(color='grey')
  
  plt.title('SIE Anomaly')
  
  plt.show() 
  </code></pre>