ridgeplot._color.interpolation module¶
Color interpolation utilities.
- ridgeplot._color.interpolation.interpolate_color(colorscale, p)[source]¶
Get a color from a colorscale at a given interpolation point
p
.This function always returns a color in the RGB format, even if the input colorscale contains colors in other formats.
- ridgeplot._color.interpolation.slice_colorscale(colorscale, p_lower, p_upper)[source]¶
Slice a continuous colorscale between two intermediate points.
- Parameters:
colorscale – The continuous colorscale to slice.
p_lower – The lower bound of the slicing interval. Must be >= 0 and < p_upper.
p_upper – The upper bound of the slicing interval. Must be <= 1 and > p_lower.
- Returns:
The sliced colorscale.
- Return type:
- Raises:
ValueError – If
p_lower
is >=p_upper
, or if eitherp_lower
orp_upper
are outside the range [0, 1].
- ridgeplot._color.interpolation.ColorscaleInterpolants¶
A
ColorscaleInterpolants
contains the interpolants for aColorScale
.Example
>>> interpolants: ColorscaleInterpolants = [ ... [0.2, 0.5, 1], ... [0.3, 0.7], ... ]
- class ridgeplot._color.interpolation.InterpolationContext(densities, n_rows, n_traces, x_min, x_max)[source]¶
Bases:
object
Context information needed by the interpolation functions.
- densities: Densities¶
- x_min: Numeric¶
- x_max: Numeric¶
- protocol ridgeplot._color.interpolation.InterpolationFunc[source]¶
Bases:
Protocol
Classes that implement this protocol must have the following methods / attributes:
- ridgeplot._color.interpolation.SolidColormode¶
See
ridgeplot.ridgeplot.colormode
for more information.alias of
Literal
[‘row-index’, ‘trace-index’, ‘trace-index-row-wise’, ‘mean-minmax’, ‘mean-means’]