ptvis.color.DiscreteColorConversion¶
- class ptvis.color.DiscreteColorConversion(colors=None, levels=None, value_min=None, value_max=None, lower_color=None, higher_color=None, na_color='#444444', n_intervals=10, closed='low', include_boundary=True)[source]¶
Bases:
BaseNumericalColorConversionColor conversion from numerical values to discrete colors.
- 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.n_intervals (
int, optional) – Number of intervals or discrete colors.closed (
{'low', 'high'}, optional) – Closed endpoint of an interval.include_boundary (
bool, optional) – IfTrue, both boundaries are included in the domain.
Attributes
Closed endpoint of an interval.
Colors defining a color scale.
Color for values higher than the domain.
Whether both boundaries are included in the domain.
Levels defining a color scale.
Color for values lower than the domain.
Number of intervals.
Color for NaN.
Value corresponding to the highest level.
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.