Skip to content
warintPublic

About

PyStatlas: A Python gallery of statistical graphics for the social sciences, by Thierry Warin (www.warin.ca). Examples of charts on real social-science data, organised by the question they answer; every figure reports its statistics, with copy-paste code.

Topics

Resources

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Repository files navigation

PyStatlas logo

PyStatlas

A Python gallery of statistical graphics for the social sciences.
61 charts · 12 families · copy‑paste Python code · inspired by the R Graph Gallery, ggstats and ggstatsplot.

Browse the gallery →
English · Français · 日本語 · 中文
Created by Thierry Warin · www.warin.ca


PyStatlas is a curated atlas of statistical charts for Python: coefficient plots, odds‑ratio forests, Likert scales, Kaplan–Meier curves with risk tables, regression diagnostics, SHAP explanations, spatial autocorrelation maps, meta‑analysis forests and more. Each chart is a single, self‑contained script built on NumPy, pandas, Matplotlib, seaborn, SciPy, statsmodels, scikit‑learn, lifelines, SHAP, GeoPandas, Shapely, libpysal and esda — no downloads, no hidden helpers.

The examples are set in published research

Nearly every chart takes its setting from one of Thierry Warin's papers — party manifestos, central-bank speeches, fake news on Facebook, patent grants in China's pharmaceutical industry, the Mundellian trilemma, waste reduction in manufacturing — and the spatial charts from the CIRANO GVCdtLab's digital twin of the Great Lakes–St. Lawrence corridor. The data are small seeded simulations, just large enough to show the method: they are labelled as simulated on every figure and are not the papers' data or results. The full reference is printed under each chart. The exceptions: the power curve uses no data, and the meta-analysis and funnel plots use real data — a published table by Raudenbush (1984), typed in.

The repository is the gallery

i18n/                     website translations (en, fr, ja, zh)
gallery/
  <NN-family>/
    _category.yaml        family title + summary
    <NN-chart>/
      plot.py             the code (metadata in the docstring)
      plot.png            the rendered figure
      README.md           browsable on GitHub

Browse the folders right here on GitHub, or visit the website.

Families

Machine learning — How well does a model predict on new data, and why? Out-of-fold evaluation, learning curves and model-agnostic explanations — each with its uncertainty.
Confusion matrix with metrics · Precision–recall curves · Learning curve · Cross-validated model comparison · Permutation importance · Partial dependence with ICE curves · SHAP summary (beeswarm) · SHAP dependence plot · SHAP waterfall for one prediction
Spatial data — Is a value higher where its neighbours' values are higher? Spatial weights, global and local spatial autocorrelation, and how far clusters reach — along a schematic Great Lakes–St. Lawrence corridor.
Choropleth with spatial weights · Moran scatterplot (global autocorrelation) · LISA cluster map (local autocorrelation) · Spatial correlogram
Distributions — See the shape of your data: histograms, densities, ridgelines, ECDFs and Q–Q plots.
Histogram with density · Raincloud plot · Ridgeline plot · ECDF comparison · Q–Q plot with confidence band
Group comparisons — Compare groups with the test, effect size and p-values on the chart — the ggstatsplot way.
Between-groups comparison · Within-subjects comparison · Estimation plot · Interaction plot · Tukey HSD intervals
Proportions & surveys — Proportions, cross-tabs and Likert scales, in the spirit of ggstats::gglikert and stat_prop.
Diverging Likert chart · Stacked proportions by group · Mosaic plot with Pearson residuals · Proportions with confidence intervals · Cross-table with standardized residuals
Correlation & association — Correlation matrices, scatterplots with statistics and pairwise relationships.
Correlation matrix · Scatterplot with statistics · Pairs plot with correlations · Correlogram with clustering
Regression models — Coefficient plots, odds ratios, model comparison and marginal effects — ggcoef_model for Python.
Coefficient plot · Odds-ratio forest plot · Comparing nested models · Predicted probabilities · Interaction effects · Quantile regression process
Model diagnostics — Residuals, leverage, calibration and ROC curves: check before you trust a model.
Residual diagnostics · Influence plot · ROC curves · Calibration plot · Added-variable plots
Survival analysis — Kaplan–Meier curves with risk tables, cumulative hazards and Cox model hazard ratios.
Kaplan–Meier curves · Cox hazard ratios · Cumulative hazard · Adjusted survival curves
Time series — Decomposition, autocorrelation, forecasts with prediction intervals and change over time.
STL decomposition · ACF and PACF · SARIMA forecast · Seasonal subseries plot
Multivariate & clustering — PCA biplots, scree plots, clustering and heatmaps for high-dimensional data.
PCA biplot · Scree plot · Silhouette plot for k-means · Clustered heatmap
Inference & uncertainty — Bootstrap, confidence intervals, power, agreement and meta-analysis forest plots.
Bootstrap distribution · What a 95% confidence interval means · Power curve · Bland–Altman plot · Meta-analysis forest plot · Funnel plot

Research behind the examples

Reference Charts set in it
Kouloukoui et al. (2023), global conversations on ESG topics Confusion matrix with metrics · Cross-table with standardized residuals
Melchior, Warin & Oliveira (2025), COVID-19 fake-news sharing on Facebook Precision–recall curves · Learning curve
Warin, d'Anglade & de Marcellis-Warin (2025), data science for waste reduction in manufacturing Cross-validated model comparison · Permutation importance · Partial dependence with ICE curves · SHAP summary (beeswarm) · SHAP dependence plot · SHAP waterfall for one prediction · Within-subjects comparison
CIRANO GVCdtLab, digital twin of the Great Lakes–St. Lawrence corridor Choropleth with spatial weights · Moran scatterplot (global autocorrelation) · LISA cluster map (local autocorrelation) · Spatial correlogram
Sanger & Warin (2019), similarity of European party manifestos Histogram with density · Clustered heatmap
de Marcellis-Warin, Kouloukoui & Warin (2025), AI-related tweets Raincloud plot
Stojkov, Warin & Kjosevski (2026), current accounts of OECD countries Ridgeline plot
Pastoriza Rivas & Warin (2022), Tiger Woods press conferences and performance ECDF comparison
Warin (2021), global research on coronaviruses Q–Q plot with confidence band
Kouloukoui et al. (2021), perceived exposure to climate risks Between-groups comparison · What a 95% confidence interval means
Warin, Melchior & de Marcellis-Warin (2025), public engagement with the WHO on X Estimation plot
de Marcellis-Warin et al. (2022), AI and consumer manipulation Interaction plot
Sanger & Warin (2020), the speeches of the ECB's presidents Tukey HSD intervals
Melchior, Warin & Oliveira (2026), survey on COVID-19 fake-news sharing Diverging Likert chart
Sanger & Warin (2018), the 2014 Québec election on Twitter Stacked proportions by group
Stojkov & Warin (2023), the refugee crisis on Twitter Mosaic plot with Pearson residuals
Kouloukoui, de Marcellis-Warin & Warin (2025), corporate climate transition plans Proportions with confidence intervals
Stojkov & Warin (2019), the Mundellian trilemma dataset Correlation matrix
Janicki, Warin & Wunnava (2009), endogenous optimum currency areas Scatterplot with statistics
Hadengue & Warin (2014), specialisation and convergence in Brazil, China and India Pairs plot with correlations
Dedinec, Stojkov, Warin & Kocarev (2026), the development compression trap Correlogram with clustering
Stojkov, Veljanovski & Warin (2024), European integration and growth in emerging Europe Coefficient plot
Blakely & Warin (2012), the decision to migrate in Europe Odds-ratio forest plot
Stojkov & Warin (2018), EU membership and FDI Comparing nested models
Kouloukoui, de Marcellis-Warin & Warin (2025), public perceptions of AI Predicted probabilities
Stojkov & Warin (2021), foreign capital and domestic funding conditions Interaction effects
Troadec & Warin (2015), Canadian firms in global R&D Quantile regression process
Tengia, Wandschneider, Warin & Wunnava (2011), Southern African trade integration Residual diagnostics · Added-variable plots
Warin & Stojkov (2021), banks' foreign claims after the 2008 crisis Influence plot
Marty & Warin (2025), algorithmic collusion and antitrust ROC curves
Zarea et al. (2026), supply-chain resilience and digitalisation Calibration plot
Vorreuther & Warin (2021), patent velocity in China's pharmaceutical industry Kaplan–Meier curves · Cox hazard ratios · Adjusted survival curves
Hadengue, de Marcellis-Warin & Warin (2015), reverse innovation in pharmaceuticals Cumulative hazard
Warin (2024), Statistics Canada's open economic data for teaching STL decomposition · SARIMA forecast · Seasonal subseries plot
Warin & Stojkov (2023), sovereign bond yield differentials in Europe ACF and PACF
Stojkov & Warin (2025), the Western Balkans and the future of Europe PCA biplot
Aubert et al. (2026), digital skills in Canadian jobs Scree plot
Chaffa & Warin (2026), industrial clusters from growth co-movement Silhouette plot for k-means
Leiter & Warin (2012), price dispersion on the internet Bootstrap distribution
Bisson & Warin (2026), AI-assisted reading of IPCC synthesis reports Bland–Altman plot

Use a chart

pip install -r requirements.txt
python gallery/05-regression-models/01-coefficient-plot/plot.py

For the exact look of the gallery, drop pystatlas.mplstyle next to your script and add plt.style.use("pystatlas.mplstyle").

Build the site

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python build.py            # renders new/changed charts, READMEs and docs/

The website in docs/ is served by GitHub Pages.

How to cite

If PyStatlas helped your research, teaching or work, please cite it:

Warin, T. (2026). PyStatlas: A Python Gallery of Statistical Graphics for the Social Sciences (Version 1.1.0) [Computer software]. https://warint.github.io/pystatlas/

@misc{warin2026statlas,
  author       = {Warin, Thierry},
  title        = {PyStatlas: A Python Gallery of Statistical Graphics for the Social Sciences},
  year         = {2026},
  version      = {1.1.0},
  howpublished = {\url{https://warint.github.io/pystatlas/}},
  note         = {Source code: https://github.com/warint/pystatlas}
}

GitHub's "Cite this repository" button (right sidebar) gives APA and BibTeX from CITATION.cff.

Author

Thierry Warin — www.warin.ca

Contributing

New charts are welcome — see CONTRIBUTING.md.

License

MIT © Thierry Warin

About

PyStatlas: A Python gallery of statistical graphics for the social sciences, by Thierry Warin (www.warin.ca). Examples of charts on real social-science data, organised by the question they answer; every figure reports its statistics, with copy-paste code.

Topics

Resources

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages