Skip to content

Publication-Ready Figures

These lessons connect figures to the comparisons they report. Most draw the same data in R and Python, from two-group box plots to survival curves and clustered heatmaps. The analysis starts with the study design and the quantity to estimate; the plot then shows the observations and the result.

State the experimental unit and target comparison before selecting the statistical method. The two-group lesson shows a mean difference or geometric mean ratio with its confidence interval and numerical p-value. A diagnostic p-value does not select the test automatically. Each page states its example data, analysis, and container environment.

Figure What it compares Test on the plot
Two-group comparison one outcome, two groups Prespecified Welch mean difference or geometric mean ratio, with intervals
Multi-group comparison one outcome, three or more groups one-way ANOVA + Tukey HSD
Factorial ANOVA one outcome, two crossed factors Type II ANOVA with interaction
Kaplan-Meier survival time to event, two arms log-rank
Cox forest plot adjusted hazard per covariate Cox proportional hazards
Clustered heatmap expression, features by samples hierarchical clustering
UpSet plot set membership across five assays intersection counts
Raincloud plot one outcome, distribution shape kernel density, mode count
Rainclouds with ggrain penguin body mass and simulated paired measurements descriptive distributions and participant connections
FactoMineR PCA figures many variables, samples in a plane variance explained, contributions
ggstatsplot two groups, and paired data test, effect size and Bayes factor on the plot

Most pages show the same figure in both languages, in synced tabs, so you can read whichever you know and see its twin.

  • R uses stats and ggplot2 for the two-group lesson, ggpubr and rstatix for other comparison plots, survminer for survival, ComplexHeatmap for the heatmap, ComplexUpset and ggrain for the set and distribution figures, and FactoMineR with factoextra for the multivariate ones.
  • Python uses scipy and matplotlib for the two-group lesson. Other pages use seaborn with statannotations and pingouin for comparison plots, lifelines for survival, seaborn.clustermap for the heatmap, and upsetplot and ptitprince for the set and distribution figures.

The two-group page uses the locked proteomics:0.1.1 image. The other five pages at the start of the catalog use pubplot. The UpSet, raincloud and FactoMineR pages need packages no pubplot image carries, so they run in a second pinned image, figextra, built from a Containerfile in the code repo. The ggstatsplot page runs in a third, ggstats, for the ggstatsplot dependency tree. Which container a page used is stated on the page.

The complete ggrain lesson uses R with ggrain 0.1.2 and ggplot2 4.0.3. It provides a downloadable script, input tables, and vector figures.

Three pages focus on R packages. The FactoMineR, ggstatsplot, and complete ggrain lessons teach their respective R interfaces. The original raincloud comparison includes both R and Python.

The two-group runner checks eight shared estimates, interval limits, and p-values for numerical agreement. The figures use each library’s own boxplot and point layout, so they need not have identical pixels. That page also provides public copies of its invented input tables.

The companion directory contains the runners and fixtures and requires repository access. Use the statistics guide to choose a model before adapting a figure to a new experiment.