Statistical plot annotation
Adds correct p-value brackets and effect sizes to group plots in R or Python, so your figures hold up to review.
What we improved
Corrected the ggpubr default test. The original said stat_compare_means defaults to a t-test; it defaults to Wilcoxon for two groups and Kruskal-Wallis for more, and ggsignif defaults to Wilcoxon. Corrected the multiple testing workflow. Th
Improved by YourAISkill from the original by GPTomics, under its MIT licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.
Claude's review
9/10 Excellent, accurate guide to annotated stats plots that catches real traps (p.adjust.method not reaching brackets, R 4.4 paired formula change, pseudoreplication, star scales) with runnable code.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Add p-value brackets, significance asterisks, and effect-size annotations to distribution plots using ggpubr, ggsignif, and statannotations with correct test selection (parametric vs non-parametric vs paired), multiple-testing adjustment, and rendering of negative results. Use when a boxplot/violin/raincloud needs in-figure statistical comparisons between groups.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: bio-data-visualization-statistical-annotation
description: "Add p-value brackets, significance stars and effect sizes to box, violin and dot plots with ggpubr, rstatix, ggsignif (R) or statannotations (Python), choosing a test that fits the data (paired or unpaired, two or more groups, nested cells-within-patients) and applying multiple-testing adjustment that actually reaches the brackets. Covers the traps that make annotated figures wrong: p.adjust.method being ignored for comparison brackets, different star cut-offs between tools, pseudoreplication, hidden non-significant pairs, and p-values without effect sizes. Use when a figure needs in-plot statistical comparisons between groups or when reviewing one."
tool_type: mixed
primary_tool: ggpubr
---
<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by GPTomics. See CHANGES.md. -->
## Version Compatibility
Reference examples written for: ggpubr 0.6+, rstatix 0.7+, ggsignif 0.6+, lmerTest 3.1+,
emmeans 1.8+, R 4.3+; statannotations 0.6+ with seaborn and scipy (Python).
Before relying on a pattern, check the installed versions:
- R: `packageVersion('<pkg>')`, then `?function_name`
- Python: `pip show <package>`, then `help(module.function)`
If code throws an error, read the installed function's help and adapt rather than retrying.
# Statistical Annotation
**"Add p-values to my plot"** -> pick the test from the design, compute all pairwise results
in a table (rstatix in R, statannotations or scipy in Python) with the adjustment you intend,
then draw that table onto the plot. Computing p-values *inside* the plotting layer is where most
annotated figures go wrong.
## The Two Most Important Facts
1. **The test must match the design, not the tool default.** ggpubr's `stat_compare_means()` and
`compare_means()` default to Wilcoxon rank-sum for two groups and Kruskal-Wallis for more;
`ggsignif::geom_signif()` defaults to Wilcoxon. Those defaults are neither always right nor
always wrong. Decide from the design:
- **Paired or repeated measures** (same subject before/after): a paired test or a mixed model.
- **Nested** (many cells per patient, technical replicates per sample): the unit of
replication is the patient or sample. Aggregate first or use a mixed model.
- **More than two groups:** an omnibus test plus adjusted post-hoc comparisons.
- **Shape:** skewed, positive data (expression, concentrations) are often analysed on a log
scale with a t-test; rank tests suit ordinal data and heavy outliers.
2. **`p.adjust.method` does not adjust comparison brackets in `stat_compare_means()`.** When you
pass `comparisons = ...`, each bracket is computed separately (via ggsignif) and the
...From GPTomics's repository, MIT licence.
Related skills
-
Checked
Statistical analysis guide
Picks the right statistical test, checks assumptions, sizes samples and writes up results in APA style.
7/101 credit -
Checked
melonJS Vector and Matrix Maths
Stops the silent vector and matrix bugs in melonJS games, like dropped depth values and slow clones.
8/101 credit -
Checked
Metabolomics Statistics
Tests which metabolites differ between groups and validates PLS-DA models properly.
9/101 credit -
Checked
Maths Proof Polisher
Rewrites a checked mathematical proof so readers can follow every step, without changing the maths itself.
8/101 credit -
Checked
Patient Maths Tutor
Explains maths ideas clearly and guides you through problems so you learn to solve and check them yourself.
7/101 credit -
Checked
401k Plan Decoder
Reads your 401k paperwork and shows fees, match and vesting in real dollars, plus the questions to ask HR.
7/101 credit