Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides to adding significance asterisks and brackets to comparison plots, with matplotlib and seaborn box, violin, and bar plot examples.
96% 100%+4 ptsof test cases passed
Passed 24 of 24 test cases with the skill, and 23 of 24 without it.
3 of 3 safety checks passed
Not used yet
Statistical significance annotations (asterisk notation) are visual markers placed on comparison plots to indicate the results of hypothesis tests between groups. They consist of brackets connecting two groups and asterisk symbols denoting the p-value range. Proper annotation ensures that the visual claims in a figure match the quantitative evidence, making plots publication-ready and scientifically rigorous. This guide covers the standard conventions, when and how to annotate, and a reusable matplotlib implementation.
The widely adopted convention maps p-value ranges to asterisk symbols:
| Symbol | P-value Range | Meaning |
|---|---|---|
| ns | p > 0.05 | Not significant |
| * | p <= 0.05 | Significant |
| ** | p <= 0.01 | Highly significant |
| *** | p <= 0.001 | Very highly significant |
| **** | p <= 0.0001 | Extremely significant |
The conversion function:
def pvalue_to_asterisk(p: float) -> str:
"""Convert a p-value to standard asterisk notation."""
if p <= 0.0001:
return "****"
elif p <= 0.001:
return "***"
elif p <= 0.01:
return "**"
elif p <= 0.05:
return "*"
else:
return "ns"
Next to this one in the catalogue, plus more from the same author.