ridgeplot._obj.traces.base module¶
Base trace object and utilities.
- ridgeplot._obj.traces.base._D3HF = '.7'¶
Default (d3-format) format for floats in hover labels.
After trying to read through the plotly.py source code, I couldn’t find a simple way to replicate the default hover format using the d3-format syntax in Plotly’s ‘hovertemplate’ parameter. The closest I got was by using the string below, but it’s not quite the same… (see ‘.7~r’ as well)
- ridgeplot._obj.traces.base._DEFAULT_HOVERTEMPLATE = '(%{x:.7}, %{customdata[0]:.7})<br><extra>%{fullData.name}</extra>'¶
Default
hovertemplate
for density traces.The default hover template that should be used for all density traces. It displays the x and y values of the hovered point, as well as the trace’s name. When using this as
hovertemplate=DEFAULT_HOVERTEMPLATE
, it is expected that the trace’scustomdata
is set to a list of lists, where each inner list contains a single element that is the y-value of the corresponding x-value (e.g.customdata=[[y_i] for y_i in y]
). Thename
attribute of the trace should also be set to the desired label for the trace (e.g.name=self.label
).
- class ridgeplot._obj.traces.base.ColoringContext(colorscale: 'ColorScale', fillgradient: 'bool', opacity: 'float | None', interpolation_ctx: 'InterpolationContext')[source]¶
Bases:
object
- colorscale: ColorScale¶
- interpolation_ctx: InterpolationContext¶