code: def _truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100):
      
      new_cmap = LinearSegmentedColormap.from_list(
          'trunc({n},{a:.2f},{b:.2f})'.format(n=cmap.name, a=minval, b=maxval),
          cmap(numpy.linspace(minval, maxval, n))
      )
      return new_cmap
docs: Truncates a colormap to use.
      Code originall from http://stackoverflow.com/questions/18926031/how-to-extract-a-subset-of-a-colormap-as-a-new-colormap-in-matplotlib