statsplotly.plot_objects package

This subpackage defines data models wrapping plotly.graph_objects with custom methods and attributes.

Subpackages

Submodules

statsplotly.plot_objects.trace module

pydantic model statsplotly.plot_objects.trace.BarTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field error_x: dict[str, Any] | None = None
field error_y: dict[str, Any] | None = None
field hoverinfo: str = 'x+y+name+text'
field marker: dict[str, Any] | None = None
field orientation: str [Required]
field text: str | pd.Series | None = None
field textposition: str | None = None
classmethod build_trace(trace_data: TraceData | AggregationTraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, bar_plot_specifier: OrientedPlotSpecifier) BarTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.BaseTrace

Bases: BaseModel

Fields:
field legendgroup: str | None = None
field name: str [Required]
field opacity: float | None = None
field showlegend: bool | None = None
field x: pd.Series | NDArray[Any] | None = None
field y: pd.Series | NDArray[Any] | None = None
abstract build_trace(*args: Any, **kwargs: Any) BaseTrace

This method implements the logic to generate the Trace object.

static get_error_bars(trace_data: TraceData) list[dict[str, Any] | None]

Computes error bars. ‘Upper’ and ‘lower’ bounds are calculated relative to the underlying data.

pydantic model statsplotly.plot_objects.trace.BoxTrace

Bases: _OrientedTrace, _BasePlotlyTrace

Fields:
field boxmean: bool = True
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, categorical_plot_specifier: CategoricalPlotSpecifier) BoxTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.ContourTrace

Bases: _DensityTrace, _BasePlotlyTrace

Fields:
field colorscale: str | list[list[str | float]] | None = None
field hoverinfo: str = 'all'
field ncontours: int [Required]
field reversescale: bool = True
field showscale: bool = False
classmethod build_trace(trace_data: TraceData, trace_name: str, color_specifier: ColorSpecifier, jointplot_specifier: JointplotSpecifier) ContourTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.EcdfTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str = 'all'
field line: dict[str, Any] [Required]
field mode: TraceMode = TraceMode.LINES
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, histogram_specifier: HistogramSpecifier) EcdfTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.HeatmapTrace

Bases: _DensityTrace, _BasePlotlyTrace

Fields:
field colorbar: dict[str, Any] | None = None
field colorscale: str | list[list[str | float]] | None = None
field hoverinfo: str = 'x+y+z+text'
classmethod build_histmap_trace(trace_data: TraceData, trace_name: str, color_specifier: ColorSpecifier, jointplot_specifier: JointplotSpecifier) HeatmapTrace
classmethod build_trace(trace_data: TraceData, trace_name: str, color_specifier: ColorSpecifier) HeatmapTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.Histogram2dTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field colorbar: dict[str, Any] | None = None
field colorscale: str | list[list[str | float]] | None = None
field histnorm: HistogramNormType | None = None
field hoverinfo: str = 'all'
field marker: dict[str, Any] | None = None
field xbins: dict[str, Any] | None = None
field ybins: dict[str, Any] | None = None
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, jointplot_specifier: JointplotSpecifier) Histogram2dTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.HistogramLineTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str [Required]
field line: dict[str, Any] [Required]
field mode: TraceMode = TraceMode.LINES
field showlegend: bool = True
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, histogram_specifier: HistogramSpecifier, hline_coordinates: tuple[str, float] | None = None, vline_coordinates: tuple[str, float] | None = None) HistogramLineTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.HistogramTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field cumulative: dict[str, Any] | None = None
field histnorm: HistogramNormType | None = None
field hoverinfo: str = 'all'
field marker: dict[str, Any] | None = None
field xbins: dict[str, Any] | None = None
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, histogram_specifier: HistogramSpecifier) HistogramTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.KdeTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str = 'x+y'
field line: dict[str, Any] [Required]
field mode: TraceMode = TraceMode.LINES
field showlegend: bool = False
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, histogram_specifier: HistogramSpecifier) KdeTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.RugTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str [Required]
field line: dict[str, Any] | None = None
field mode: TraceMode = TraceMode.LINES
field showlegend: bool = False
field text: str | pd.Series | None = None
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, histogram_specifier: HistogramSpecifier) RugTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.Scatter3DTrace

Bases: _ScatterBaseTrace, _BasePlotlyTrace

Fields:
field error_z: dict[str, Any] | None = None
field hoverinfo: str = 'x+y+z+name+text'
field z: pd.Series | NDArray[Any] [Required]
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, mode: TraceMode | None) Scatter3DTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.ScatterTrace

Bases: _ScatterBaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str = 'x+y+name+text'
field line: dict[str, Any] | None = None
classmethod build_id_line(x_values: Series, y_values: Series) ScatterTrace
classmethod build_regression_trace(trace_data: TraceData, trace_name: str, trace_color: str, regression_type: RegressionType) ScatterTrace
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, mode: TraceMode | None) ScatterTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.ShadedTrace

Bases: _ScatterBaseTrace, _BasePlotlyTrace

Fields:
field fill: str [Required]
field fillcolor: str [Required]
field hoverinfo: str = 'x+y+name+text'
field line: dict[str, Any] [Required]
classmethod build_lower_error_trace(trace_data: TraceData, trace_name: str, trace_color: str | None) ShadedTrace
classmethod build_upper_error_trace(trace_data: TraceData, trace_name: str, trace_color: str | None) ShadedTrace
model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.StepHistogramTrace

Bases: BaseTrace, _BasePlotlyTrace

Fields:
field hoverinfo: str = 'all'
field line: dict[str, Any] [Required]
field mode: TraceMode = TraceMode.LINES
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, histogram_specifier: HistogramSpecifier) StepHistogramTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.StripTrace

Bases: _CategoricalTrace, _BasePlotlyTrace

Fields:
field mode: str = TraceMode.MARKERS
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, categorical_plot_specifier: CategoricalPlotSpecifier) StripTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

pydantic model statsplotly.plot_objects.trace.ViolinTrace

Bases: _OrientedTrace, _BasePlotlyTrace

Fields:
field meanline_visible: bool = True
field scalemode: str = 'width'
classmethod build_trace(trace_data: TraceData, trace_name: str, trace_color: str | None, color_specifier: ColorSpecifier, categorical_plot_specifier: CategoricalPlotSpecifier) ViolinTrace

This method implements the logic to generate the Trace object.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.