ContinuousColormap.to_discrete(samples=10, name=None, **kwargs)[source]

Convert the ContinuousColormap to a DiscreteColormap by drawing samples from the colormap.

  • samples (int or sequence of float, optional) – If integer, draw samples at the colormap coordinates np.linspace(0, 1, samples). If sequence of float, draw samples at the specified points.

  • name (str, optional) – The new colormap name. Default is '_name_copy'.

Other Parameters

**kwargs – Passed to DiscreteColormap.