statsplotly package¶
- statsplotly.barplot(data: DataFrame | dict[str, Sequence[ndarray[tuple[Any, ...], dtype[Any]]]] | ndarray[tuple[Any, ...], dtype[Any]], x: str | None = None, y: str | None = None, orientation: Literal['horizontal', 'vertical'] | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color: str | None = None, color_palette: list[str] | str | None = None, shared_coloraxis: bool = False, color_limits: Sequence[float] | None = None, logscale: float | None = None, colorbar: bool = True, text: str | None = None, axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, opacity: float | None = None, barmode: Literal['stack', 'group', 'overlay', 'relative'] | None = None, error_bar: Literal['sem', 'iqr', 'std', 'geo_std', 'bootstrap'] | Callable[[Any], ndarray[tuple[Any, ...], dtype[Any]]] | None = None, aggregation_func: Literal['mean', 'geo_mean', 'count', 'median', 'percent', 'fraction', 'sum'] | Callable[[Any], float] | None = None, x_label: str | None = None, y_label: str | None = None, title: str | None = None, x_range: Sequence[float | str] | None = None, y_range: Sequence[float | str] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None) Figure¶
Draws a barplot across levels of categorical variable.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data.
y – The name of the y dimension column in data.
orientation – A
PlotOrientationvalue to force the orientation of the plot.slicer – The name of the column in data with values to slice the data : one trace is drawn for each level of the slicer dimension.
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color – The name of the column in data with values to map onto the colormap.
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
- The color palette is used, by order of precedence :
To map color data specified by the color parameter onto the corresponding
colormap. - To assign discrete colors to slices of data.
shared_coloraxis – If True, colorscale limits are shared across slices of data.
color_limits – A tuple specifying the (min, max) values of the colormap.
logscale – A float specifying the log base to use for colorscaling.
colorbar – If True, draws a colorbar.
text – A string or the name of the column in data with values to appear in the hover
columns. (tooltip. Column names can be concatenated with '+' to display values from multiple) – Ignored when aggregation_func is not None.
axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval to specify bar opacity.
barmode – A
BarModevalue.error_bar – A
ErrorBarTypevalue or a Callable taking the x or y dimension as input and returning a (dow, up) limit tuple.aggregation_func – A
AggregationTypevalue or a Callable taking the x or y dimension as input and returning a single value.x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
title – A string for the title of the plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the column to add the plot to.
- Returns:
A
plotly.graph_obj.Figure.
- statsplotly.catplot(data: DataFrame | dict[str, Sequence[ndarray[tuple[Any, ...], dtype[Any]]]] | ndarray[tuple[Any, ...], dtype[Any]], x: str | None = None, y: str | None = None, orientation: Literal['horizontal', 'vertical'] | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color: str | None = None, color_palette: list[str] | str | None = None, shared_coloraxis: bool = False, text: str | None = None, marker: str | None = None, axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, opacity: str | float | None = None, plot_type: Literal['boxplot', 'violinplot', 'stripplot'] | None = None, jitter: float | None = None, normalizer: Literal['center', 'minmax', 'zscore'] | None = None, size: float = 6, x_label: str | None = None, y_label: str | None = None, title: str | None = None, x_range: Sequence[float | str] | None = None, y_range: Sequence[float | str] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None) Figure¶
Draws a stripplot/boxplot/violinplot across levels of a categorical variable.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data.
y – The name of the y dimension column in data.
orientation – A
PlotOrientationvalue to force the orientation of the plot.slicer – The name of the column in data with values to slice the data : one trace is drawn for each level of the slicer dimension.
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color – The name of the column in data with values to map onto the colormap.
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
- The color palette is used, by order of precedence :
To map color data specified by the color parameter onto the corresponding
colormap. - To assign discrete colors to slices of data.
shared_coloraxis – If True, colorscale limits are shared across slices of data.
text – A string or the name of the column in data with values to appear in the hover
columns. (tooltip. Column names can be concatenated with '+' to display values from multiple)
marker – A valid marker symbol or the name of the column in data with values to assign marker symbols.
axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval or the name of the column in data with values to specify marker opacity.
plot_type – A
CategoricalPlotTypevalue.jitter – A numeric value to specify jitter amount on the categorical dimension.
normalizer – A
NormalizationTypevalue to normalize data on the continous dimension.size – A numeric value or the name of the column in data with values to assign mark sizes.
x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
title – A string for the title of the plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the column to add the plot to.
- Returns:
A
plotly.graph_obj.Figure.
- statsplotly.distplot(data: DataFrame, x: str | None = None, y: str | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color_palette: list[str] | str | None = None, axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, opacity: float | None = None, hist: bool = True, rug: bool | None = None, ecdf: bool | None = None, kde: bool | None = None, step: bool | None = None, equal_bins: bool | None = None, bins: Sequence[float] | int | str | None = None, cumulative: bool | None = None, histnorm: Literal['', 'percent', 'probability', 'probability density'] | None = None, central_tendency: Literal['mean', 'median', 'mode'] | None = None, vlines: dict[str, tuple[str, float]] | None = None, hlines: dict[str, tuple[str, float]] | None = None, barmode: Literal['stack', 'overlay'] | None = None, x_label: str | None = None, y_label: str | None = None, title: str | None = None, x_range: Sequence[float] | None = None, y_range: Sequence[float] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None) Figure¶
Draws the distribution of x (vertical histogram) or y (horizontal histograms) values.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data. If not None, draws vertical histograms.
y – The name of the y dimension column in data. If not None, draws horizontal histograms.
slicer – The name of the column in data with values to slice the data : one trace is drawn for each level of the slicer dimension.
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
The color palette is used to assign discrete colors to slices of data.
axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval to specify bar and line opacity.
hist – If True, plot histogram bars.
rug – If True, plot rug bars of the underlying data.
ecdf – If True, plot the Empirical Cumulative Density Function.
kde – If True, plot a line of a Kernel Density Estimation of the distribution.
step – If True, plot a step histogram instead of a standard histogram bars.
equal_bins – If True, uses the same bins for all slices in the data.
bins – A string, integer, or sequence specifying the bins parameter for
numpy.histogram().cumulative – If True, draws a cumulative histogram.
histnorm – A
HistogramNormTypevalue.central_tendency – A
CentralTendencyTypevalue.vlines – A dictionary of {slice: (line_name, vertical_coordinates)} to draw vertical lines.
hlines – A dictionary of {slice: (line_name, horizontal_coordinates)} to draw horizontal lines.
barmode – A
HistogramBarModevalue.x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
title – A string for the title of the plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the column to add the plot to.
- Returns:
A
plotly.graph_obj.Figure.
- statsplotly.heatmap(data: DataFrame | dict[str, Sequence[ndarray[tuple[Any, ...], dtype[Any]]]] | ndarray[tuple[Any, ...], dtype[Any]], x: str | None = None, y: str | None = None, z: str | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color_palette: list[str] | str | None = None, shared_coloraxis: bool = False, color_limits: Sequence[float] | None = None, logscale: float | None = None, colorbar: bool = True, text: str | None = None, axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, opacity: float | None = None, normalizer: Literal['center', 'minmax', 'zscore'] | None = None, x_label: str | None = None, y_label: str | None = None, z_label: str | None = None, title: str | None = None, x_range: Sequence[float | str] | None = None, y_range: Sequence[float | str] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None) Figure¶
Draws a heatmap.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data.
y – The name of the y dimension column in data.
z – The name of the z dimension (i.e., color) column in data.
slicer – The name of the column in data with values to slice the data : one trace is drawn for each level of the slicer dimension.
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
- The color palette is used, by order of precedence :
To map color data specified by the color parameter onto the corresponding
colormap. - To assign discrete colors to slices of data.
shared_coloraxis – If True, colorscale limits are shared across slices of data.
color_limits – A tuple specifying the (min, max) values of the colormap.
logscale – A float specifying the log base to use for colorscaling.
colorbar – If True, draws a colorbar.
text – A string or the name of the column in data with values to appear in the hover
columns. (tooltip. Column names can be concatenated with '+' to display values from multiple)
axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval to specify heatmap opacity.
normalizer – The normalizer for the z dimension. A
NormalizationTypevalue.x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
z_label – A string to label the coloraxis in place of the corresponding column name in data .
title – A string to label the resulting plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the colum to add the plot to.
- Returns:
A
plotly.graph_obj.Figure.
- statsplotly.jointplot(data: DataFrame | dict[str, Sequence[ndarray[tuple[Any, ...], dtype[Any]]]] | ndarray[tuple[Any, ...], dtype[Any]], x: str | None = None, y: str | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color: str | None = None, color_palette: list[str] | str | None = None, shared_coloraxis: bool = False, color_limits: Sequence[float] | None = None, logscale: float | None = None, colorbar: bool = True, text: str | None = None, marker: str | None = None, mode: Literal['markers', 'lines', 'markers+lines', 'lines+text'] | None = 'markers', axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, marginal_plot: Literal['x', 'y', 'all'] | None = 'all', kde_color_palette: list[str] | str = 'magma', hist: bool = True, rug: bool | None = None, ecdf: bool | None = None, kde: bool | None = None, step: bool | None = None, equal_bins_x: bool | None = None, equal_bins_y: bool | None = None, bins_x: Sequence[float] | int | str = 'scott', bins_y: Sequence[float] | int | str = 'scott', histnorm: Literal['', 'percent', 'probability', 'probability density'] | None = None, central_tendency: Literal['mean', 'median', 'mode'] | None = None, barmode: Literal['stack', 'overlay'] | None = None, plot_type: Literal['scatter', 'kde', 'scatter+kde', 'x_histmap', 'y_histmap', 'histogram'] = 'scatter', opacity: float = 0.8, jitter_x: float = 0, jitter_y: float = 0, normalizer_x: Literal['center', 'minmax', 'zscore'] | None = None, normalizer_y: Literal['center', 'minmax', 'zscore'] | None = None, shaded_error: str | None = None, error_x: str | None = None, error_y: str | None = None, fit: Literal['linear', 'exponential', 'inverse'] | None = None, size: float | str | None = None, x_label: str | None = None, y_label: str | None = None, title: str | None = None, x_range: Sequence[float | str] | None = None, y_range: Sequence[float | str] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None) Figure¶
Draws a plot of two variables with bivariate and univariate graphs.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data.
y – The name of the y dimension column in data.
slicer – The name of the column in data with values to slice the data : one trace is drawn
dimension. (for each level of the slicer)
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color – The name of the column in data with values to map onto the colormap. Specifying a
StatsPlotSpecificationError. (color along with marginal != None raises a)
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
- The color palette is used, by order of precedence :
To map color data specified by the color parameter onto the corresponding
colormap. - To assign discrete colors to slices of data.
shared_coloraxis – If True, colorscale limits are shared across slices of data.
color_limits – A tuple specifying the (min, max) values of the colormap.
logscale – A float specifying the log base to use for colorscaling.
colorbar – If True, draws a colorbar.
text – A string or the name of the column in data with values to appear in the hover
columns. (tooltip. Column names can be concatenated with '+' to display values from multiple)
marker – A valid marker symbol or the name of the column in data with values to assign
symbols. (marker)
mode – A
TraceModevalue.axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval to specify bar and line opacity.
marginal_plot – A
MarginalPlotDimensionvalue.kde_color_palette – The color_palette for the Kernel Density Estimation map.
hist – If True, plot histogram bars.
rug – If True, plot rug bars of the underlying data.
ecdf – If True, plot the Empirical Cumulative Density Function.
kde – If True, plot a line of a Kernel Density Estimation of the distribution.
step – If True, plot a step histogram instead of a standard histogram bars.
equal_bins_x – If True, uses the same bins for the x dimension of all slices in the data.
equal_bins_y – If True, uses the same bins for the y dimension of all slices in the data.
bins_x – A string, integer, or sequence specifying the bins parameter for the x dimension for
numpy.histogram().bins_y – A string, integer, or sequence specifying the bins parameter for the y dimension for
numpy.histogram().histnorm – A
HistogramNormTypevalue.central_tendency – A
CentralTendencyTypevalue.barmode – A
BarModevalue.plot_type – A
JointplotTypevalue.opacity – A numeric value in the (0, 1) interval to specify marker opacity.
jitter_x – A numeric value to specify jitter amount on the x dimension.
jitter_y – A numeric value to specify jitter amount on the y dimension.
normalizer_x – A
NormalizationTypevalue to normalize the x dimension.normalizer_y – A
NormalizationTypevalue to normalize the y dimension.shaded_error – The name of the column in data with values to plot continuous error shade.
error_x – The name of the column in data with values to plot error bar in the x dimension .
error_y – The name of the column in data with values to plot error bar in the y dimension .
fit – A
RegressionTypevalue. Computes and plot theregression. (corresponding)
size – A numeric value or the name of the column in data with values to assign mark sizes.
x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
title – A string for the title of the plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the column to add the plot to.
- Returns:
A
plotly.graph_obj.Figure.
- statsplotly.plot(data: DataFrame | dict[str, Sequence[ndarray[tuple[Any, ...], dtype[Any]]]] | ndarray[tuple[Any, ...], dtype[Any]], x: str | None = None, y: str | None = None, z: str | None = None, slicer: str | None = None, slice_order: list[Any] | None = None, color: str | None = None, color_palette: list[str] | str | None = None, shared_coloraxis: bool = False, color_limits: Sequence[float] | None = None, logscale: float | None = None, colorbar: bool = True, text: str | None = None, marker: str | None = None, mode: Literal['markers', 'lines', 'markers+lines', 'lines+text'] | None = None, axis: Literal['square', 'fixed_ratio', 'equal', 'id_line'] | None = None, opacity: str | float | None = None, jitter_x: float = 0, jitter_y: float = 0, jitter_z: float = 0, normalizer_x: Literal['center', 'minmax', 'zscore'] | None = None, normalizer_y: Literal['center', 'minmax', 'zscore'] | None = None, normalizer_z: Literal['center', 'minmax', 'zscore'] | None = None, shaded_error: str | None = None, error_x: str | None = None, error_y: str | None = None, error_z: str | None = None, fit: Literal['linear', 'exponential', 'inverse'] | None = None, size: float | str | None = None, x_label: str | None = None, y_label: str | None = None, z_label: str | None = None, title: str | None = None, x_range: Sequence[float | str] | None = None, y_range: Sequence[float | str] | None = None, z_range: Sequence[float | str] | None = None, fig: Figure | None = None, row: int | None = None, col: int | None = None, secondary_y: bool = False) Figure¶
Draws a line/scatter plot across levels of a categorical variable.
- Parameters:
data – A
pandas.DataFrame-compatible structure of datax – The name of the x dimension column in data.
y – The name of the y dimension column in data.
z – The name of the z dimension column in data.
slicer – The name of the column in data with values to slice the data : one trace is drawn
dimension. (for each level of the slicer)
slice_order – A list of identifiers to order and/or subset data slices specified by slicer.
color – The name of the column in data with values to map onto the colormap.
color_palette –
A string refering to a built-in plotly, seaborn or matplotlib colormap.
A list of CSS color names or HTML color codes.
- The color palette is used, by order of precedence :
To map color data specified by the color parameter onto the corresponding
colormap. - To assign discrete colors to slices of data.
shared_coloraxis – If True, colorscale limits are shared across slices of data.
color_limits – A tuple specifying the (min, max) values of the colormap.
logscale – A float specifying the log base to use for colorscaling.
colorbar – If True, draws a colorbar.
text – A string or the name of the column in data with values to appear in the hover
columns. (tooltip. Column names can be concatenated with '+' to display values from multiple)
marker – A valid marker symbol or the name of the column in data with values to assign marker symbols.
mode – A
TraceModevalue.axis – A
AxisFormatvalue.opacity – A numeric value in the (0, 1) interval or the name of the column in data with values to specify marker opacity.
jitter_x – A numeric value to specify jitter amount on the x dimension.
jitter_y – A numeric value to specify jitter amount on the y dimension.
jitter_z – A numeric value to specify jitter amount on the z dimension.
normalizer_x – A
NormalizationTypevalue for the x dimension.normalizer_y – A
NormalizationTypevalue for the y dimension.normalizer_z – A
NormalizationTypevalue for the z dimension.shaded_error – The name of the column in data with values to plot continuous error shade.
error_x – The name of the column in data with values to plot error bar in the x dimension .
error_y – The name of the column in data with values to plot error bar in the y dimension .
error_z – The name of the column in data with values to plot error bar in the z dimension .
fit – A
RegressionTypevalue. Computes and plot the corresponding regression.size – A numeric value or the name of the column in data with values to assign mark sizes.
x_label – A string to label the x_axis in place of the corresponding column name in data.
y_label – A string to label the y_axis in place of the corresponding column name in data.
z_label – A string to label the z_axis in place of the corresponding column name in data.
title – A string for the title of the plot.
x_range – A tuple defining the (min_range, max_range) of the x_axis.
y_range – A tuple defining the (min_range, max_range) of the y_axis.
z_range – A tuple defining the (min_range, max_range) of the z_axis.
fig – A
plotly.graph_obj.Figureto add the plot to. Use in conjunction with row and col.row – An integer identifying the row to add the plot to.
col – An integer identifying the column to add the plot to.
secondary_y – If True, plot on a secondary y_axis of the fig object.
- Returns:
A
plotly.graph_obj.Figure.
Subpackages¶
- statsplotly.plot_objects package
- statsplotly.plot_specifiers package
- Subpackages
- Submodules
- statsplotly.plot_specifiers.common module
- statsplotly.plot_specifiers.trace module
CategoricalPlotSpecifierCategoricalPlotTypeHistogramSpecifierHistogramSpecifier.bin_edgesHistogramSpecifier.binsHistogramSpecifier.central_tendencyHistogramSpecifier.cumulativeHistogramSpecifier.data_typeHistogramSpecifier.dimensionHistogramSpecifier.ecdfHistogramSpecifier.histHistogramSpecifier.histnormHistogramSpecifier.kdeHistogramSpecifier.rugHistogramSpecifier.stepHistogramSpecifier.check_binsHistogramSpecifier.check_cumulativeHistogramSpecifier.check_dimensionHistogramSpecifier.check_histnormHistogramSpecifier.check_parameter_consistencyHistogramSpecifier.compute_ecdf()HistogramSpecifier.compute_histogram()HistogramSpecifier.get_distribution_max_value()HistogramSpecifier.get_histogram_bin_edges()HistogramSpecifier.density
JointplotSpecifierJointplotSpecifier.histogram_specifierJointplotSpecifier.marginal_plotJointplotSpecifier.plot_typeJointplotSpecifier.scatter_specifierJointplotSpecifier.check_scatter_specifierJointplotSpecifier.compute_histmap()JointplotSpecifier.histogram2d()JointplotSpecifier.plot_kdeJointplotSpecifier.plot_scatterJointplotSpecifier.plot_x_distributionJointplotSpecifier.plot_y_distribution
JointplotTypeMarginalPlotDimensionOrientedPlotSpecifierPlotOrientationScatterSpecifierTraceMode
Submodules¶
statsplotly.constants module¶
statsplotly.exceptions module¶
Custom exceptions.
- exception statsplotly.exceptions.StatsPlotSpecificationError¶
Bases:
ValueErrorRaises when plot arguments are incompatibles.
statsplotly.types module¶
statsplotly.utils module¶
- pydantic model statsplotly.utils.SubplotGridFormatter¶
Bases:
_SubplotGridValidatorWraps a Plotly Figure with methods to format the subplot grid.
- fig¶
A
plotly.graph_objects.Figurewith a subplot grid.
- Fields:
- Validators:
- set_common_axis_limit(shared_grid_axis: Literal['cols', 'rows', 'all'] = 'all', plot_axis: Literal['xaxis', 'yaxis', 'coloraxis'] | None = None, common_range: bool = True, link_axes: bool = False) SubplotGridFormatter¶
Set common axis limits along a shared grid axis, optionally linking the axes.
- Parameters:
shared_grid_axis – A
SharedGridAxisvalue.plot_axis –
A
PlotAxisvalue.Defaults to
YAXISwhenshared_grid_axis=rows.Defaults to
XAXISwhenshared_grid_axis=cols.Raises a
StatsPlotSpecificationErrorwhenNoneandshared_grid_axis=all.
common_range – If
True(default), set a common range for the axes targeted byplot_axis.link_axes – If
True(defaultFalse), link the axes targeted byplot_axis.
- Returns:
A
SubplotGridFormatterinstance.
- set_common_coloraxis(shared_grid_axis: SharedGridAxis) SubplotGridFormatter¶
Set a common coloraxis along a shared grid axis.
- Parameters:
shared_grid_axis – A
SharedGridAxisvalue.- Returns:
A
SubplotGridFormatterinstance.
- tidy_subplots(title: str | None = None, no_legend: bool = False, row_titles: Sequence[str] | None = None, col_titles: Sequence[str] | None = None) SubplotGridFormatter¶
Tidy a subplot grid by removing redundant axis titles and optionally adding annotations.
- Parameters:
title – A string for the figure title.
no_legend – If True, hides the legend.
row_titles – A list of string the size of the row dimension specifying a title for each row.
col_titles – A list of string the size of the column dimension specifying a title for each column.
- Returns:
A
SubplotGridFormatterinstance.
- statsplotly.utils.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.