statsplotly.plot_specifiers.color package

This subpackage defines objects and utility methods for color properties.

pydantic model statsplotly.plot_specifiers.color.ColorSpecifier

Bases: BaseModel

Fields:
  • barmode (statsplotly.plot_specifiers.layout._core.BarMode | None)

  • color_limits (list[float] | None)

  • color_palette (str | list[str] | None)

  • coloraxis_reference (statsplotly.plot_specifiers.layout._core.ColoraxisReference | None)

  • colorbar (bool | None)

  • colormap (dict[str | numpy.datetime64 | bool, Any] | None)

  • logscale (float | None)

  • opacity (float | None)

Validators:
  • check_logscale » logscale

  • check_opacity » opacity

field barmode: BarMode | None = None
field color_limits: list[float] | None = None
field color_palette: str | list[str] | None = None
field coloraxis_reference: ColoraxisReference | None = None
field colorbar: bool | None = None
field colormap: dict[str | np.datetime64 | bool, Any] | None = None
field logscale: float | None = None
Validated by:
  • check_logscale

field opacity: float | None = None
Validated by:
  • check_opacity

build_coloraxis(color_data: Series | None, shared: bool = False) ColorAxis
build_colorbar(color_values: Series | None) dict[str, Any] | None
build_colorscale(color_data: Series | None) str | list[list[float | str]] | None
classmethod build_from_color_data(color_data: Series, **kwargs: Any) ColorSpecifier
validator check_logscale  »  logscale
validator check_opacity  »  opacity
static convert_datetime_to_timestamp(x: datetime64) float
format_color_data(color_data: str | Series) Series
get_color_hues(n_colors: int) list[str]
property cmax: float | None
property cmin: float | None
property zmax: float | None
property zmin: float | None
pydantic model statsplotly.plot_specifiers.color.HistogramColorSpecifier

Bases: ColorSpecifier

Fields:
  • opacity (float)

Validators:
  • check_opacity » opacity

field opacity: float [Required]
Validated by:
  • check_opacity

validator check_opacity  »  opacity
statsplotly.plot_specifiers.color.rgb_string_array_from_colormap(n_colors: int, color_palette: str | list[str] | list[tuple[float, float, float]] | Colormap | None) list[str]

Returns a list of RGB string given n_colors and a color_palette reference.

This function attempts to extract RGB color values from built-in Plotly, Seaborn and finally Matplotlib colormaps.

statsplotly.plot_specifiers.color.set_rgb_alpha(color_ref: str | tuple[float, float, float], alpha: float = 1) str

Return a rgba string from a color reference.