splot.mapping.truncate_colormap

splot.mapping.truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100)[source]

Function to truncate a colormap by selecting a subset of the original colormap’s values

Parameters
cmapstr or matplotlib.cm instance

Colormap to be altered

minvalfloat, optional

Minimum value of the original colormap to include in the truncated colormap. Default =0.0.

maxvalMaximum value of the original colormap to

include in the truncated colormap. Default =1.0.

nint, optional

Number of intervals between the min and max values for the gradient of the truncated colormap. Default =100.

Returns
new_cmapA new colormap that has been shifted.