About PyStatlas

Statistical charts for Python, set in real research questions from the social sciences and organised by the question they answer. Machine learning — how well a model predicts and why — and spatial data — maps and spatial autocorrelation — sit alongside distributions, group comparisons, regression and survival, and every figure reports the statistics behind it: estimates, confidence intervals, tests, effect sizes.

PyStatlas starts from the questions researchers ask, not from the code. It was first written for social-science students who know their field and need to answer a question with data: do these groups differ, do two variables move together, what does the model predict and why? Each chart puts the relevant statistics on the figure and comes with a short, self-contained script built on the scientific Python stack — in the spirit of ggstats and ggstatsplot in R.

Principles

Families

FamilyChartsWhat you'll find
Machine learning9How well does a model predict on new data, and why? Out-of-fold evaluation, learning curves and model-agnostic explanations — each with its uncertainty.
Spatial data4Is 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.
Distributions5See the shape of your data: histograms, densities, ridgelines, ECDFs and Q–Q plots.
Group comparisons5Compare groups with the test, effect size and p-values on the chart — the ggstatsplot way.
Proportions & surveys5Proportions, cross-tabs and Likert scales, in the spirit of ggstats::gglikert and stat_prop.
Correlation & association4Correlation matrices, scatterplots with statistics and pairwise relationships.
Regression models6Coefficient plots, odds ratios, model comparison and marginal effects — ggcoef_model for Python.
Model diagnostics5Residuals, leverage, calibration and ROC curves: check before you trust a model.
Survival analysis4Kaplan–Meier curves with risk tables, cumulative hazards and Cox model hazard ratios.
Time series4Decomposition, autocorrelation, forecasts with prediction intervals and change over time.
Multivariate & clustering4PCA biplots, scree plots, clustering and heatmaps for high-dimensional data.
Inference & uncertainty6Bootstrap, confidence intervals, power, agreement and meta-analysis forest plots.
Academic tables6Publication-ready tables — regression tables, summary statistics and model results typeset like a journal page, with Great Tables. stargazer for Python.

Author

PyStatlas is created and maintained by Thierry Warin. More of his work on data science, statistics and AI: www.warin.ca.

How to cite

PyStatlas is created and maintained by Thierry Warin. If it helped your 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://warin.ca/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://warin.ca/pystatlas/}},
  note         = {Source code: https://github.com/warint/pystatlas}
}

Contribute

Add a folder with a plot.py, run python build.py, open a pull request. See CONTRIBUTING.md.

Thank you

PyStatlas stands on the shoulders of open-source software, open data and the R community. Every example is built with, or inspired by, the work below.

Python packages used in the examples

NumPy · pandas · Matplotlib · seaborn · SciPy · statsmodels · scikit-learn · lifelines · SHAP · GeoPandas · libpysal · esda · Shapely · Great Tables · linearmodels · pyfixest

Datasets

Inspiration

R packages whose charts the examples mirror

BlandAltmanLeh · blandr · boot · car · caret · ComplexHeatmap · corrplot · dabestr · did2s · etwfe · factoextra · feasts · fixest · forecast · GGally · ggdist · ggeffects · ggplot2 · ggpubr · ggrain · ggridges · ggstats · ggstatsplot · iml · interactions · ivreg · marginaleffects · meta · metafor · modelsummary · pdp · performance · pheatmap · probably · pROC · pwr · qqplotr · quantreg · rgeoda · rms · shapviz · spdep · stargazer · survminer · TeachingDemos · tidymodels · tune · vcd · vip · yardstick

Building the site

PyYAML · Pygments · Pillow · GitHub Pages

Research and data sources

Nearly every example is set in the context of one of the author's published papers, or of the CIRANO GVCdtLab for the spatial charts, and runs on a small seeded simulation built for the example — never the paper's data or results. Each entry gives the full reference and the charts set in it. The meta-analysis and funnel plots are the exception: they use a real published table, typed in.

  • Teacher-expectancy experiments (Raudenbush, 1984). Raudenbush, S. W. (1984). Magnitude of teacher expectancy effects on pupil IQ as a function of the credibility of expectancy induction: A synthesis of findings from 18 experiments. Journal of Educational Psychology, 76(1), 85–97. https://doi.org/10.1037/0022-0663.76.1.85
    Effect sizes and variances typed in from dat.raudenbush1985 in R's metadat/metafor (Viechtbauer, 2010, Journal of Statistical Software, 36(3), https://doi.org/10.18637/jss.v036.i03); one of the 18 experiments contributes two rows.
    Used in: Meta-analysis forest plot, Funnel plot
  • Sanger & Warin (2019), similarity of European party manifestos. Sanger, W., & Warin, T. (2019). Dataset of Jaccard similarity indices from 1,597 European political manifestos across 27 countries (1945–2017). Data in Brief, 24, 103907. https://doi.org/10.1016/j.dib.2019.103907
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Histogram with density, Clustered heatmap
  • de Marcellis-Warin, Kouloukoui & Warin (2025), AI-related tweets. de Marcellis-Warin, N., Kouloukoui, D., & Warin, T. (2025). A large-scale dataset of AI-related tweets: Structure and descriptive statistics. Data in Brief, 62, 111960. https://doi.org/10.1016/j.dib.2025.111960
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Raincloud plot
  • Stojkov, Warin & Kjosevski (2026), current accounts of OECD countries. Stojkov, A., Warin, T., & Kjosevski, J. (2026). Beyond the balance: An intertemporal perspective on the current accounts of OECD countries. Acta Oeconomica, 76(3), 402–429. https://doi.org/10.1556/032.2026.00539
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Ridgeline plot
  • Pastoriza Rivas & Warin (2022), Tiger Woods press conferences and performance. Pastoriza Rivas, D., & Warin, T. (2022). Dataset of two decades of Tiger Woods press conferences and tournament performance. Data in Brief, 41, 107955. https://doi.org/10.1016/j.dib.2022.107955
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: ECDF comparison
  • Warin (2021), global research on coronaviruses. Warin, T. (2021). Global research on coronaviruses: Metadata-based analysis for public health policies. JMIR Medical Informatics, 9(11), e31510. https://doi.org/10.2196/31510
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Q–Q plot with confidence band
  • Kouloukoui et al. (2021), perceived exposure to climate risks. Kouloukoui, D., de Marcellis-Warin, N., Armellini, F., Warin, T., & Andrade Torres, E. (2021). Factors influencing the perception of exposure to climate risks: Evidence from the world's largest carbon-intensive industries. Journal of Cleaner Production, 306, 127160. https://doi.org/10.1016/j.jclepro.2021.127160
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Between-groups comparison, What a 95% confidence interval means
  • Warin, d'Anglade & de Marcellis-Warin (2025), data science for waste reduction in manufacturing. Warin, T., d'Anglade, P. M., & de Marcellis-Warin, N. (2025). Optimising industrial efficiency: Integrating K-means clustering and data science for sustainable manufacturing and waste reduction. International Journal of Sustainable Engineering, 18(1), 2527300. https://doi.org/10.1080/19397038.2025.2527300
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: 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
  • Warin, Melchior & de Marcellis-Warin (2025), public engagement with the WHO on X. Warin, T., Melchior, C., & de Marcellis-Warin, N. (2025). Social media metrics and popular legitimacy: Content analysis of pre- and post-COVID-19 public engagement with the WHO on X. Journal of Medical Internet Research, 27, e69959. https://doi.org/10.2196/69959
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Estimation plot
  • de Marcellis-Warin et al. (2022), AI and consumer manipulation. de Marcellis-Warin, N., Marty, F., Thelisson, E., & Warin, T. (2022). Artificial intelligence and consumer manipulations: From consumer's counter algorithms to firm's self-regulation tools. AI and Ethics, 2(2), 259–268. https://doi.org/10.1007/s43681-022-00149-5
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Interaction plot
  • Sanger & Warin (2020), the speeches of the ECB's presidents. Sanger, W., & Warin, T. (2020). The speeches of the European Central Bank's presidents: An NLP study. Global Economy Journal, 20(2), 2050009. https://doi.org/10.1142/s2194565920500098
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Tukey HSD intervals
  • Melchior, Warin & Oliveira (2026), survey on COVID-19 fake-news sharing. Melchior, C., Warin, T., & Oliveira, M. (2026). Survey data on COVID-19-related fake-news sharing on Facebook. Data in Brief, 65, 112533. https://doi.org/10.1016/j.dib.2026.112533
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Diverging Likert chart
  • Sanger & Warin (2018), the 2014 Québec election on Twitter. Sanger, W., & Warin, T. (2018). The public's perception of political parties during the 2014 Québec election on Twitter. Canadian Journal of Communication, 43(2), 245–263. https://doi.org/10.22230/cjc.2018v43n2a3251
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Stacked proportions by group
  • Stojkov & Warin (2023), the refugee crisis on Twitter. Stojkov, A., & Warin, T. (2023). Discursive dynamics and local contexts on Twitter: The refugee crisis in Europe. Discourse & Communication, 17(3), 354–380. https://doi.org/10.1177/17504813231155739
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Mosaic plot with Pearson residuals
  • Kouloukoui, de Marcellis-Warin & Warin (2025), corporate climate transition plans. Kouloukoui, D., de Marcellis-Warin, N., & Warin, T. (2025). Barriers, opportunities and best practices for corporate climate transition plans: A literature review. Climate, 13(5), 88. https://doi.org/10.3390/cli13050088
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Proportions with confidence intervals
  • Kouloukoui et al. (2023), global conversations on ESG topics. Kouloukoui, D., de Marcellis-Warin, N., Gomes, S. M. S., & Warin, T. (2023). Mapping global conversations on twitter about environmental, social, and governance topics through natural language processing. Journal of Cleaner Production, 414, 137369. https://doi.org/10.1016/j.jclepro.2023.137369
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Confusion matrix with metrics, Cross-table with standardized residuals
  • Stojkov & Warin (2019), the Mundellian trilemma dataset. Stojkov, A., & Warin, T. (2019). Navigating through the Mundellian trilemma: A dataset of four decades. Data in Brief, 27, 104677. https://doi.org/10.1016/j.dib.2019.104677
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Correlation matrix
  • Janicki, Warin & Wunnava (2009), endogenous optimum currency areas. Janicki, H., Warin, T., & Wunnava, P. (2009). Testing Mundell's intuition of endogenous OCA theory. Review of International Economics, 17(1), 74–86. https://doi.org/10.1111/j.1467-9396.2008.00802.x
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Scatterplot with statistics, Instrumental variables table
  • Hadengue & Warin (2014), specialisation and convergence in Brazil, China and India. Hadengue, M., & Warin, T. (2014). Patterns of specialization and (un)conditional convergence: The cases of Brazil, China and India. Management international, 18, 123–141. https://doi.org/10.7202/1027869ar
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Pairs plot with correlations
  • Dedinec, Stojkov, Warin & Kocarev (2026), the development compression trap. Dedinec, A., Stojkov, A., Warin, T., & Kocarev, L. (2026). The development compression trap: A framework for understanding uneven development trajectories. Journal of Sustainable Development of Energy, Water and Environment Systems, 15(1).
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Correlogram with clustering
  • Stojkov, Veljanovski & Warin (2024), European integration and growth in emerging Europe. Stojkov, A., Veljanovski, M., & Warin, T. (2024). European integration and economic growth in emerging Europe: The role of institutions and policy factors. Post-Communist Economies, 36(7), 778–800. https://doi.org/10.1080/14631377.2024.2376974
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Coefficient plot, Regression table, stargazer style
  • Blakely & Warin (2012), the decision to migrate in Europe. Blakely, A., & Warin, T. (2012). Choice or mimetism in the decision to migrate? A European illustration. Global Economy Journal, 12(2). https://doi.org/10.1515/1524-5861.1818
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Odds-ratio forest plot, Summary statistics table
  • Stojkov & Warin (2018), EU membership and FDI. Stojkov, A., & Warin, T. (2018). EU membership and FDI: Is there an endogenous credibility effect? Journal of East-West Business, 24, 144–169. https://doi.org/10.1080/10669868.2018.1431579
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Comparing nested models, Panel data regression table
  • Kouloukoui, de Marcellis-Warin & Warin (2025), public perceptions of AI. Kouloukoui, D., de Marcellis-Warin, N., & Warin, T. (2025). Balancing risks and benefits: Public perceptions of AI through traditional surveys and social media analysis. AI & Society, 40(6), 4919–4942. https://doi.org/10.1007/s00146-025-02232-x
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Predicted probabilities
  • Stojkov & Warin (2021), foreign capital and domestic funding conditions. Stojkov, A., & Warin, T. (2021). Foreign capital and domestic funding conditions: A Mundellian trilemma perspective. Global Economy Journal, 21, 2150008. https://doi.org/10.1142/s2194565921500081
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Interaction effects
  • Troadec & Warin (2015), Canadian firms in global R&D. Troadec, A., & Warin, T. (2015). La place des entreprises canadiennes dans la R-D mondiale. In B. Sinclair-Desgagné, A. Van Assche & T. Warin (Eds.), L'économie du Québec 2015 : contexte et enjeux internationaux (ch. 4, pp. 109–125). Presses internationales Polytechnique.
    The example is set in the context of this chapter; unless its description says otherwise, the numbers are simulated and are not the chapter's data or results.
    Used in: Quantile regression process
  • Tengia, Wandschneider, Warin & Wunnava (2011), Southern African trade integration. Tengia, O., Wandschneider, K., Warin, T., & Wunnava, P. (2011). Southern African economic integration: Evidence from an augmented gravity model. African Finance Journal, 13(1).
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Residual diagnostics, Added-variable plots
  • Warin & Stojkov (2021), banks' foreign claims after the 2008 crisis. Warin, T., & Stojkov, A. (2021). Banks' foreign claims in the aftermath of the 2008 crisis: Institutional response, financial efficiency, and integration of cross-border banking in the euro area. Journal of Risk and Financial Management, 14(2), 61. https://doi.org/10.3390/jrfm14020061
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Influence plot
  • Marty & Warin (2025), algorithmic collusion and antitrust. Marty, F., & Warin, T. (2025). Deciphering algorithmic collusion: Insights from bandit algorithms and implications for antitrust enforcement. Journal of Economy and Technology, 3, 34–43. https://doi.org/10.1016/j.ject.2024.10.001
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: ROC curves, Difference-in-differences table
  • Zarea et al. (2026), supply-chain resilience and digitalisation. Zarea, H., Moghaddamzadeh, H., Moradi, M., Hassani, A., Warin, T., & Stojkov, A. (2026). Risk-driven capability development in global supply chain resilience: Implications for digitalization. Journal of Information Technology Management, 82–107. https://jitm.ut.ac.ir/article_108005.html
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Calibration plot
  • Vorreuther & Warin (2021), patent velocity in China's pharmaceutical industry. Vorreuther, C. M., & Warin, T. (2021). Patent relatedness and velocity in the Chinese pharmaceutical industry: A dataset of Jaccard similarities. Data in Brief, 35, 106814. https://doi.org/10.1016/j.dib.2021.106814
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Kaplan–Meier curves, Cox hazard ratios, Adjusted survival curves
  • Hadengue, de Marcellis-Warin & Warin (2015), reverse innovation in pharmaceuticals. Hadengue, M., de Marcellis-Warin, N., & Warin, T. (2015). Reverse innovation and reverse technology transfer: From made in China to discovered in China in the pharmaceutical sector. Management international, 19(4), 49–69. https://doi.org/10.7202/1043076ar
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Cumulative hazard
  • Warin (2024), Statistics Canada's open economic data for teaching. Warin, T. (2024). Access Statistics Canada's open economic data for statistics and data science courses. Technology Innovations in Statistics Education, 15(1). https://doi.org/10.5070/t5.1868
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not Statistics Canada's figures.
    Used in: STL decomposition, SARIMA forecast, Seasonal subseries plot
  • Warin & Stojkov (2023), sovereign bond yield differentials in Europe. Warin, T., & Stojkov, A. (2023). Sovereign bond yield differentials across Europe: A structural entropy perspective. Entropy, 25(4), 630. https://doi.org/10.3390/e25040630
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: ACF and PACF
  • Stojkov & Warin (2025), the Western Balkans and the future of Europe. Stojkov, A., & Warin, T. (2025). Western Balkans and the future of Europe. Springer. https://doi.org/10.1007/978-3-031-86465-0
    The example is set in the context of this book; unless its description says otherwise, the numbers are simulated and are not the book's data or results.
    Used in: PCA biplot
  • Aubert et al. (2026), digital skills in Canadian jobs. Aubert, B., Bourdeau, S., Warin, T., Schneider, J., & Sénegas, T. (2026). Digital skills assessment in jobs in Canada. Journal for Labour Market Research, 60(1), 18. https://doi.org/10.1186/s12651-026-00440-6
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Scree plot
  • Chaffa & Warin (2026), industrial clusters from growth co-movement. Chaffa, L., & Warin, T. (2026). Identifying industrial clusters through growth co-movement with unsupervised learning methods. GeoJournal, 91(1), 16. https://doi.org/10.1007/s10708-025-11564-6
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Silhouette plot for k-means
  • Leiter & Warin (2012), price dispersion on the internet. Leiter, D., & Warin, T. (2012). Homogenous goods markets: An empirical study of price dispersion on the internet. International Journal of Economics and Business Research, 4(5), 514. https://doi.org/10.1504/ijebr.2012.048776
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Bootstrap distribution
  • Bisson & Warin (2026), AI-assisted reading of IPCC synthesis reports. Bisson, C., & Warin, T. (2026). AI-assisted longitudinal comparison of scenario knowledge representation in IPCC synthesis reports. PLOS Climate, 5(7), e0000965. https://doi.org/10.1371/journal.pclm.0000965
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Bland–Altman plot
  • Melchior, Warin & Oliveira (2025), COVID-19 fake-news sharing on Facebook. Melchior, C., Warin, T., & Oliveira, M. (2025). An investigation of the COVID-19-related fake news sharing on Facebook using a mixed methods approach. Technological Forecasting and Social Change, 213, 123969. https://doi.org/10.1016/j.techfore.2024.123969
    The example is set in the context of this paper; unless its description says otherwise, the numbers are simulated and are not the paper's data or results.
    Used in: Precision–recall curves, Learning curve, Machine learning model comparison table
  • CIRANO GVCdtLab, digital twin of the Great Lakes–St. Lawrence corridor. CIRANO. GVCdtLab: Digital twin of the Great Lakes–St. Lawrence trade and transport corridor (researcher in charge: T. Warin). Supported by Transport Canada's National Trade Corridors Fund; research on hydrological change, maritime traffic and trade funded by the Fonds de recherche du Québec. https://cirano.qc.ca/en/research/pole/Transport
    The examples are set in the context of the lab's work; the hexagonal zones form a schematic map of the corridor and the values are simulated — they are not the lab's data, geography or results.
    Used in: Choropleth with spatial weights, Moran scatterplot (global autocorrelation), LISA cluster map (local autocorrelation), Spatial correlogram

The examples illustrate statistical methods. Their numbers are simulated unless an entry says otherwise, and their titles describe what each figure shows in these simulated data — not findings of the cited papers, nor the author's position on the substantive question. For results, context and data, rely on the papers cited here.