Distribution
Static
Box and Whisker Plot
Box and whisker plots (boxplots) provide a standardized way of displaying data distribution based on five key statistics: minimum, first quartile (Q1), median, third quartile (Q3), and maximum. The 'box' shows the interquartile range (IQR), while 'whiskers' extend to show data range, and individual points mark outliers. This visualization is essential for comparing distributions across groups, identifying skewness, and detecting outliers in your data.
Example Visualization
.png&w=1920&q=75)
Try this prompt
"Use seaborn to create a box plot comparing 'Gene Expression' across 4 'Genotypes'. Overlay jittered points for individual samples. Perform pairwise t-tests against the 'WT' control and add significance brackets with stars (* p<0.05, ** p<0.01). Generate a proper example dataset to demonstrate this visualization."
Generate this nowConsole Output
Output
Generated dataset: 80 samples across 4 genotypes
count mean std min 25% 50% 75% max
Genotype
KO1 20.0 1.433506 0.242010 1.010082 1.229742 1.435316 1.549965 1.963070
KO2 20.0 0.794662 0.164170 0.447392 0.697058 0.805572 0.928675 1.011424
Mutant 20.0 1.190581 0.333626 0.414076 1.043802 1.207683 1.444461 1.669393
WT 20.0 0.965740 0.192006 0.617344 0.870256 0.953171 1.101635 1.315843
Pairwise t-test p-values against WT:
KO1: t=-6.772, p=6.439e-08
KO2: t=3.029, p=4.454e-03
Mutant: t=-2.612, p=1.386e-02
Significant genotypes (p<0.05): ['KO1', 'KO2', 'Mutant']Common Use Cases
- 1Comparing experimental groups in scientific research
- 2Detecting outliers in datasets
- 3Analyzing test score distributions
- 4Quality control in manufacturing
Pro Tips
Overlay individual data points for small datasets
Use notched boxplots to compare medians visually
Add statistical significance annotations when comparing groups