Forest plot
Available since v3.4.40
GWASLab provides a function to create forest plots for meta-analysis results, displaying individual study effect estimates with confidence intervals and combined meta-analysis estimates.
gl.plot_forest()
Options
| Option | DataType | Description | Default |
|---|---|---|---|
data |
pd.DataFrame or str |
DataFrame containing study data, or path to whitespace-separated file | required |
study_col |
string |
Column name containing study identifiers | required |
group_col |
string, bool, or None |
Column name for grouping studies. If False/None, all in "Group1" | None |
beta_col |
string |
Column name for effect estimates (beta) | "beta" |
se_col |
string |
Column name for standard errors | "se" |
compact_factor |
float |
Factor to adjust figure height (higher = more compact) | 1.0 |
width_ratios |
list |
Width ratios for subplot columns [group, plot, text] | [2, 6, 2] |
sharex |
string |
Whether to share x-axis across rows | "col" |
meta |
boolean |
Whether to perform and display meta-analysis statistics | True |
combine_effects_kwargs |
dict |
Additional arguments passed to combine_effects function | None |
fig_kwargs |
dict |
Additional arguments passed to plt.subplots() | None |
save |
string, bool, or None |
Save path, True for default, or None/False to not save | None |
save_kwargs |
dict |
Additional arguments for matplotlib savefig() | None |
fontsize |
int |
Font size for labels and text | 12 |
font_family |
string |
Font family for text | "Arial" |
colors |
list |
List of colors for alternating studies. If None, uses default colors | None |
verbose |
boolean |
Whether to print progress messages | True |
Examples
Basic forest plot
Forest plot with grouping
Customized forest plot