def _truncate_colormap(cmap, minval=<NUM_LIT:0.0>, maxval=<NUM_LIT:1.0>, n=<NUM_LIT:100>):
new_cmap = LinearSegmentedColormap.from_list(<EOL>'<STR_LIT>'.format(n=cmap.name, a=minval, b=maxval),<EOL>cmap(numpy.linspace(minval, maxval, n))<EOL>)<EOL>return new_cmap<EOL>
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