ColormapColorFunc

class ColormapColorFunc(colormap='nipy_spectral', color_range=(0.0, 0.5), color_step_range=(0.15, 0.25))[source]

Represents a colormap.

Methods

ColormapColorFunc.__init__([colormap, ...])

Initialize a word cloud color generator.

ColormapColorFunc.color_func(word, ...[, ...])

Update the current color fraction and wrap around if necessary.

Attributes

ColormapColorFunc.__init__(colormap='nipy_spectral', color_range=(0.0, 0.5), color_step_range=(0.15, 0.25))[source]

Initialize a word cloud color generator.

Parameters:
  • colormap (str, optional) – The name of the matplotlib colormap to use for generating colors. Defaults to ‘nipy_spectral’.

  • color_range (tuple of float, optional) – A tuple containing the minimum and maximum values to use from the colormap. Defaults to (0.0, 0.5).

  • color_step_range (tuple of float, optional) – A tuple containing the minimum and maximum values to step through the colormap. Defaults to (0.15, 0.25). This is the speed at which it goes through the range chosen. .25 means it will go through 1/4 of the range each pick.

ColormapColorFunc.color_func(word, font_size, position, orientation, random_state=None, **kwargs)[source]

Update the current color fraction and wrap around if necessary.