Statwise.Visualization (Statwise v0.1.0)

Copy Markdown View Source

Statistical visualization builders.

Functions in this module return backend-neutral %Statwise.Visualization.Plot{} structs. Use to_vega_lite/2 to export a plot as a Vega-Lite-compatible map.

Summary

Functions

Adds a layer to a composable figure.

Builds a summary bar plot from tidy row data.

Builds a box plot from one or more numeric sample series.

Builds a confidence interval plot from a statistical test result.

Builds a count plot for a categorical field.

Builds an empirical cumulative distribution function plot.

Adds faceting to a composable figure.

Builds a heatmap from x/y/value mappings.

Builds a histogram plot from numeric sample data.

Adds labels to a composable figure.

Builds a line plot from semantic x/y mappings.

Builds a Mann-Whitney U statistic plot from a Mann-Whitney result struct.

Starts a composable visualization figure.

Builds an estimate point plot from tidy row data.

Builds a normal QQ plot.

Builds a rank plot from two samples.

Builds a scatter plot from semantic x/y mappings.

Shows a visualization plot as a Kino.VegaLite widget when Kino is available.

Builds a categorical strip plot.

Builds a t-test result plot from a t-test result struct.

Converts a visualization plot into encoded Vega-Lite JSON.

Converts a visualization plot into a Kino.VegaLite widget when Kino is available.

Converts a visualization plot into a Vega-Lite-compatible map.

Converts a visualization plot into a VegaLite struct when VegaLite is available.

Returns plot with a categorical color palette.

Returns plot with presentation style applied separately from plot data.

Annotates a categorical plot with a statistical test.

Returns plot with a named or custom visualization theme.

Functions

add(figure, type, opts \\ [])

Adds a layer to a composable figure.

annotate_test(plot, result, opts \\ [])

Alias for with_test/3.

bar_plot(data, opts \\ [])

Builds a summary bar plot from tidy row data.

box_plot(data, opts \\ [])

Builds a box plot from one or more numeric sample series.

confidence_interval(result, opts \\ [])

Builds a confidence interval plot from a statistical test result.

count_plot(data, opts \\ [])

Builds a count plot for a categorical field.

ecdf(data, opts \\ [])

Builds an empirical cumulative distribution function plot.

facet(figure, opts)

Adds faceting to a composable figure.

heatmap(data, opts \\ [])

Builds a heatmap from x/y/value mappings.

histogram(data, opts \\ [])

Builds a histogram plot from numeric sample data.

label(figure, labels)

Adds labels to a composable figure.

line(data, opts \\ [])

Builds a line plot from semantic x/y mappings.

mann_whitney(result, opts \\ [])

Builds a Mann-Whitney U statistic plot from a Mann-Whitney result struct.

plot(data, opts \\ [])

Starts a composable visualization figure.

point_plot(data, opts \\ [])

Builds an estimate point plot from tidy row data.

qq_plot(data, opts \\ [])

Builds a normal QQ plot.

rank_plot(x, y, opts \\ [])

Builds a rank plot from two samples.

scatter(data, opts \\ [])

Builds a scatter plot from semantic x/y mappings.

show(plot, opts \\ [])

Shows a visualization plot as a Kino.VegaLite widget when Kino is available.

strip_plot(data, opts \\ [])

Builds a categorical strip plot.

style(plot, style)

Alias for with_style/2.

t_test(result, opts \\ [])

Builds a t-test result plot from a t-test result struct.

to_json(plot, opts \\ [])

Converts a visualization plot into encoded Vega-Lite JSON.

to_kino(plot, opts \\ [])

Converts a visualization plot into a Kino.VegaLite widget when Kino is available.

to_vega_lite(plot, opts \\ [])

Converts a visualization plot into a Vega-Lite-compatible map.

to_vega_lite_plot(plot, opts \\ [])

Converts a visualization plot into a VegaLite struct when VegaLite is available.

with_palette(plot, palette)

Returns plot with a categorical color palette.

with_style(figure, style)

Returns plot with presentation style applied separately from plot data.

with_test(plot, result, opts \\ [])

Annotates a categorical plot with a statistical test.

Pass a %Statwise.TestResult{} when the test has already been computed:

result = Statwise.TTest.independent(control, treatment, effect_size: true)

rows
|> Statwise.Visualization.box_plot(x: :group, y: :score)
|> Statwise.Visualization.with_test(result, groups: {:control, :treated})

Pass :t_test or :mann_whitney to compute the test from the plotted rows:

rows
|> Statwise.Visualization.box_plot(x: :group, y: :score, facet: :site)
|> Statwise.Visualization.with_test(:mann_whitney, groups: {:control, :treated})

For faceted plots, computed tests run independently inside each facet. Use show: to choose label fields, for example show: [:p_value, :statistic].

with_theme(plot, theme)

Returns plot with a named or custom visualization theme.