Skip to main content

staplot

Statistical analysis and publication-quality plots for biologists: a free, open-source alternative to GraphPad Prism, with a desktop app and a small Python API.

Features

  • Data tables Prism-style (one column per group) or long format; CSV and Excel import (semicolon / decimal-comma CSVs included).
  • Tests: t-tests (Welch, paired), Mann-Whitney, Wilcoxon, one- and two-way ANOVA, repeated measures, Kruskal-Wallis, post-hoc tests (Tukey, Dunn, ...), chi-square, correlation, linear and nonlinear regression (curve fitting), normality tests, outliers, ROC, survival, power analysis.
  • Plots: bar, box, violin (whole or half: violin_side="left"), split violin (kind="split_violin": two conditions as the two halves, each pair tested), scatter, grouped bar, before/after, histogram, QQ, residuals, Bland-Altman, heatmap, volcano, ROC and survival curves, with significance brackets added automatically.
  • A test wizard that picks the right test for your data and explains why.

Install

pip install staplot            # add [excel] for .xlsx / .xls import

Python 3.10 or newer.

Use

Desktop app:

staplot

Plot editor: a table beside its plot; click any part of the plot (a group, the points, the brackets, a title, an axis label, the tick labels, the legend, the plot area) to change its colour, text, size or font; edit the table's cells and the plot follows. Toolbar Edit a plot in the app, or:

python -m staplot.ui.plot_editor counts.csv box

From Python: staplot.ui.plot_editor.PlotEditor(path, kind, kwargs); after OK, kwargs() / changed_kwargs() are api.plot's arguments and text_parts() the size and font per part of the text. PyFigures opens it on a double-click on a data plot. Icons come from qtawesome when it is installed (optional).

Beyond the basic kinds, api.plot takes layers (mean / median lines, mean ± error over the groups), y2 (a measure on a right-hand axis), invert_y / invert_x, ybreak (a broken y axis), y_step / y_format / log_base, error_side="up", and the kinds stacked (percent), dose_response (4-parameter logistic fit, EC50), histogram, heatmap. api.table_from_csv(path, columns=[group, value], subject="animal") makes the animals the replicates (tests on their means, a SuperPlot, plus a mixed model). api.image_plot(path, pixel_size=0.2, unit="µm") draws an image with its coordinate axes.

From Python (no GUI needed, safe to run headless):

from staplot import api

table = api.table_from_csv("counts.csv")       # one column per group
stats = api.auto_test(table)                   # picks the test, returns p-values
fig, record = api.plot(table, kind="box")      # matplotlib Figure with brackets
fig.savefig("counts.pdf")

Tables can be CSV / TSV / TXT (separator and decimal comma detected) or Excel sheets: api.table_from_csv("book.xlsx::counts") reads the sheet counts (by name or number from 1; the first sheet without ::). api.read_table(path) gives the DataFrame, api.list_sheets(path) the sheet names, and api.csv_cleaning_report(path) what was left out (empty cells, NA, typos).

auto_test checks normality per group (Shapiro-Wilk) and chooses Welch's t-test or Mann-Whitney for two groups, and one-way ANOVA + Tukey or Kruskal-Wallis + Dunn for more.

staplot draws the plot panels of PyFigures.

Tests

pip install pytest pytest-qt
python -m pytest tests

License

BSD 2-Clause, see LICENSE.

Metadata

Release files for staplot 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for staplot 0.1.3
File Size Uploaded Provenance Actions
staplot-0.1.3.tar.gz 176.9 kB Without provenance Details for staplot-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for staplot 0.1.3
File Interpreter ABI Platform Actions
staplot-0.1.3-py3-none-any.whl Python 3 none any Details for staplot-0.1.3-py3-none-any.whl

Total release size: 363.3 kB

Release files / staplot-0.1.3.tar.gz

Download URL staplot-0.1.3.tar.gz
Size 176.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b6bd7c1759e0a92cb85331aad82de8021f4a6e4b0454757e11a8e16bea575d90
BLAKE2b-256 checksum
How to use checksums
8e2ad5eb5f570fde7b93a5aaba4e5585bdc7f1df43107b0ee578ab80927021a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / staplot-0.1.3-py3-none-any.whl

Download URL staplot-0.1.3-py3-none-any.whl
Size 186.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65cdec2743de11063d3f1badc4bd2a9b1330ca41b4a4bef2458c0d25d91a57f1
BLAKE2b-256 checksum
How to use checksums
d2d121e8744e4de185006684bc9ff8500dc6923da31986b23595353e92adaafd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for staplot 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page