ptvis.color.BaseNumericalColorConversion

class ptvis.color.BaseNumericalColorConversion(colors=None, levels=None, value_min=None, value_max=None, lower_color=None, higher_color=None, na_color='#444444')[source]

Bases: BaseColorConversion

Base color conversion from numerical values.

Parameters:
  • colors (array-like of str, optional) – Colors defining a color scale.

  • levels (array-like of float, optional) – Levels defining a color scale. Must be in ascending order. If not given, evenly spaced levels are used.

  • value_min (float, optional) – Value corresponding with the lowest level.

  • value_max (float, optional) – Value corresponding with the highest level.

  • lower_color (str, optional) – Color for values lower than the domain.

  • higher_color (str, optional) – Color for values higher than the domain.

  • na_color (str, optional) – Color for NaN.

Attributes

colors

Colors defining a color scale.

higher_color

Color for values higher than the domain.

levels

Levels defining a color scale.

lower_color

Color for values lower than the domain.

na_color

Color for NaN.

value_max

Value corresponding to the highest level.

value_min

Value corresponding to the lowest level.

Methods

apply(values)

Apply the conversion to values.

color_guide(values[, attrs])

Give a color guide.

domain(values)

Give a domain of the conversion.