Loading Plotivy
Preparing your workspace and data.
Loading Plotivy
Preparing your workspace and data.
Publication-ready visualizations for clinical trials, meta-analyses, diagnostic studies, and oncology research. Every chart includes complete Python code you can copy and run.
Clinical research figures must meet rigorous standards for transparency and reproducibility. Forest plots quantify treatment effects across studies, Kaplan-Meier curves communicate survival outcomes, and CONSORT diagrams document trial methodology. The chart types below cover the figures most frequently required by NEJM, The Lancet, JAMA, and BMJ. All code examples follow ICMJE guidelines and produce output suitable for peer review.
Clinical chart selection
Clinical figures must make the denominator, uncertainty, and patient flow clear. Choose the visualization by study question: treatment effect, survival outcome, diagnostic accuracy, method agreement, or trial reporting.
Use forest plots and funnel plots when the result combines effect estimates, confidence intervals, or study precision.
Use Kaplan-Meier curves when patient follow-up time, censoring, and at-risk counts affect interpretation.
Use ROC curves and Bland-Altman plots when the question is performance, agreement, or clinical decision thresholds.
Hypothesis testing, confidence intervals, and regression for clinical data.
Step-by-step guide to computing and plotting ROC curves with AUC.
Volcano plots, survival curves, heatmaps, and life science visualizations.
Journal requirements and best practices for clinical research figures.
Use matplotlib to draw horizontal lines (confidence intervals) with square markers (point estimates) for each study, plus a diamond for the pooled effect. The forestplot or PythonMeta libraries simplify this. Include study names on the y-axis, numerical effect sizes and CIs in a right-aligned column, and a vertical line at the null effect (1.0 for risk ratios, 0 for mean differences).
The lifelines library is the most comprehensive option, providing KaplanMeierFitter, log-rank tests, and Cox proportional hazards models. It integrates with matplotlib for publication-quality figures. The survival function, confidence intervals, and at-risk tables can all be generated with a few lines of code. See our survival curve guide for a worked example.
Plot each study's effect size on the x-axis against a measure of precision (standard error or sample size) on an inverted y-axis. A symmetric inverted funnel shape indicates no bias. Asymmetry, tested formally with Egger's regression or Begg's rank test, suggests publication bias or small-study effects. Add pseudo-confidence limits as diagonal lines from the pooled estimate.
NEJM requires figures at 300 DPI minimum in TIFF or EPS format, single-column (8.5 cm) or double-column (17.5 cm) width. The Lancet and JAMA have similar requirements. Use Arial or Helvetica fonts, minimum 8 pt size. All clinical figures must include patient counts, follow CONSORT or STROBE guidelines, and avoid 3D effects or chartjunk that distorts interpretation.