11<div id =" top " ></div >
22<h1 align =" center " >
3- < strong > Forestplot</ strong >
3+ Forestplot
44</h1 >
55<p align =" center " >
66 <a href =" https://pypi.org/project/forestplot " >
1313<p align =" center " ><img width =" 100% " src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/main.png " ></p >
1414
1515-----------------------------------------------------------
16-
1716This package makes publication-ready forest plots easy to make out-of-the-box. Users provide a ` dataframe ` (e.g. from a spreadsheet) where rows correspond to a variable/study with columns including estimates, variable labels, and lower and upper confidence interval limits.
1817Additional options allow easy addition of columns in the ` dataframe ` as annotations in the plot.
1918
2019<!-- -------------------- Project shields ---------------------->
2120
2221| | |
2322| --- | --- |
24- | Release | [ ![ PyPI] ( https://img.shields.io/pypi/v/forestplot?color=blue&label=PyPI&logo=pypi&logoColor=white )] ( https://pypi.org/project/forestplot/ ) ![ Conda (channel only)] ( https://img.shields.io/conda/vn/conda-forge/forestplot?logo=conda-forge&logoColor=white ) [ ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/lsys/forestplot?color=blue&label=Latest%20release )] ( https://github.com/LSYS/forestplot/releases ) |
23+ | Release | [ ![ PyPI] ( https://img.shields.io/pypi/v/forestplot?color=blue&label=PyPI&logo=pypi&logoColor=white )] ( https://pypi.org/project/forestplot/ ) [ ![ Conda (channel only)] ( https://img.shields.io/conda/vn/conda-forge/forestplot?logo=conda-forge&logoColor=white )] ( https://anaconda.org/conda-forge/forestplot ) [ ![ GitHub release (latest by date)] ( https://img.shields.io/github/v/release/lsys/forestplot?color=blue&label=Latest%20release )] ( https://github.com/LSYS/forestplot/releases ) |
2524| Status | [ ![ CI] ( https://github.com/LSYS/forestplot/actions/workflows/CI.yml/badge.svg )] ( https://github.com/LSYS/forestplot/actions/workflows/CI.yml ) [ ![ Notebooks] ( https://github.com/LSYS/forestplot/actions/workflows/nb.yml/badge.svg )] ( https://github.com/LSYS/forestplot/actions/workflows/nb.yml ) |
2625| Coverage | [ ![ Codecov] ( https://img.shields.io/codecov/c/github/lsys/forestplot?logo=codecov&logoColor=white&label=codecov )] ( https://app.codecov.io/gh/LSYS/forestplot ) |
2726| Python | [ ![ PyPI - Python Version] ( https://img.shields.io/pypi/pyversions/forestplot?label=Python%203.6%2B&logo=python&logoColor=white )] ( https://pypi.org/project/forestplot/ ) |
2827| Docs | [ ![ Read the Docs (version)] ( https://img.shields.io/readthedocs/forestplot/stable?label=docs&logo=readthedocs&logoColor=white )] ( https://forestplot.readthedocs.io/en/latest/?badge=latest ) [ ![ DocLinks] ( https://github.com/LSYS/forestplot/actions/workflows/links.yml/badge.svg )] ( https://github.com/LSYS/forestplot/actions/workflows/links.yml ) |
29- | Meta | ![ GitHub] ( https://img.shields.io/github/license/lsys/forestplot?color=purple&label=License ) [ ![ Language grade: Python ] ( https://img.shields.io/lgtm/grade/python/g/LSYS/forestplot.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/LSYS/forestplot/context:python ) [ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black ) [ ![ types - Mypy] ( https://img.shields.io/badge/types-Mypy-blue.svg )] ( https://github.com/python/mypy ) [ ![ DOI] ( https://zenodo.org/badge/510013191.svg )] ( https://zenodo.org/badge/latestdoi/510013191 ) |
28+ | Meta | [ ![ GitHub] ( https://img.shields.io/github/license/lsys/forestplot?color=purple&label=License )] ( https://choosealicense.com/licenses/mit/ ) [ ![ Imports: isort ] ( https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 )] ( https://pycqa.github.io/isort/ ) [ ![ Code style: black] ( https://img.shields.io/badge/code%20style-black-000000.svg )] ( https://github.com/psf/black ) [ ![ types - Mypy] ( https://img.shields.io/badge/types-Mypy-blue.svg )] ( https://github.com/python/mypy ) [ ![ DOI] ( https://zenodo.org/badge/510013191.svg )] ( https://zenodo.org/badge/latestdoi/510013191 ) |
3029| Binder| [ ![ Binder] ( https://mybinder.org/badge_logo.svg )] ( https://mybinder.org/v2/gh/lsys/forestplot/main?labpath=examples%2Freadme-examples.ipynb ) |
3130
3231<!-- -------------------- TABLE OF CONTENT ---------------------->
33- <details open ><summary ><b >Table of Contents</b ></summary ><p >
32+ # Table of Contents[ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #table-of-contents )
33+ <details open ><summary ><b >show/hide</b ></summary ><p >
3434
3535> - [ Installation] ( #installation )
3636> - [ Quick Start] ( #quick-start )
@@ -51,7 +51,7 @@ pip install forestplot
5151```
5252
5353Install from conda-forge<br >
54- ![ Conda (channel only)] ( https://img.shields.io/conda/vn/conda-forge/forestplot?logo=conda-forge&logoColor=white )
54+ [ ![ Conda (channel only)] ( https://img.shields.io/conda/vn/conda-forge/forestplot?logo=conda-forge&logoColor=white )] ( https://anaconda.org/conda-forge/forestplot )
5555``` bash
5656conda install forestplot
5757```
@@ -78,7 +78,7 @@ make test
7878
7979
8080<!-- ----------------------- QUICK START ------------------------->
81- ## Quick start [ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #quick-start )
81+ ## Quick Start [ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #quick-start )
8282
8383``` python
8484import forestplot as fp
@@ -119,7 +119,7 @@ fp.forestplot(df, # the dataframe with results data
119119 ll = " ll" , hl = " hl" , # columns containing conf. int. lower and higher limits
120120 varlabel = " label" , # column containing variable label
121121 ylabel = " Confidence interval" , # y-label title
122- xlabel = " Pearson correlation" # x-label title
122+ xlabel = " Pearson correlation" , # x-label title
123123 )
124124```
125125<p align =" left " ><img width =" 55% " src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/vanilla.png " ></p >
@@ -131,8 +131,7 @@ plt.savefig("plot.png", bbox_inches="tight")
131131<p align =" right " >(<a href =" #top " >back to top</a >)</p >
132132
133133<!-- ---------------- EXAMPLES of CUSTOMIZATIONS ------------------>
134- ## Some examples with customizations[ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #examples-with-customizations )
135-
134+ ## Some Examples With Customizations[ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #examples-with-customizations )
136135
1371361 . Add variable groupings, add group order, and sort by estimate size.
138137``` python
@@ -145,10 +144,10 @@ fp.forestplot(df, # the dataframe with results data
145144 # group ordering
146145 group_order = [" labor factors" , " occupation" , " age" , " health factors" ,
147146 " family factors" , " area of residence" , " other factors" ],
148- sort = True # sort in ascending order (sorts within group if group is specified)
147+ sort = True , # sort in ascending order (sorts within group if group is specified)
149148 )
150149```
151- <p align =" left " ><img width =" 65 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/group-grouporder-sort.png " ></p >
150+ <p align =" left " ><img width =" 75 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/group-grouporder-sort.png " ></p >
152151
1531522 . Add p-values on the right and color alternate rows gray
154153``` python
@@ -169,7 +168,7 @@ fp.forestplot(df, # the dataframe with results data
169168 )
170169```
171170
172- <p align =" left " ><img width =" 70 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/group-grouporder-pvalue-sort-colorrows.png " ></p >
171+ <p align =" left " ><img width =" 80 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/group-grouporder-pvalue-sort-colorrows.png " ></p >
173172
174173
1751743 . Customize annotations and make it a table
@@ -189,7 +188,7 @@ fp.forestplot(df, # the dataframe with results data
189188 )
190189```
191190
192- <p align =" left " ><img width =" 75 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/leftannote-rightannote-table.png " ></p >
191+ <p align =" left " ><img width =" 85 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/leftannote-rightannote-table.png " ></p >
193192
1941934 . Strip down all bells and whistle
195194``` python
@@ -233,7 +232,7 @@ fp.forestplot(df, # the dataframe with results data
233232 }
234233 )
235234```
236- <p align =" left " ><img width =" 70 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/main.png " ></p >
235+ <p align =" left " ><img width =" 80 %" src =" https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/main.png " ></p >
237236
238237<details ><summary ><i >Annotations arguments allowed include:</i ></summary >
239238
@@ -307,8 +306,10 @@ More fined-grained control for base plot options (eg font sizes, marker colors)
307306
308307<!-- ---------------------- KNOWN ISSUES ------------------------>
309308## Known Issues[ ![ ] ( https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg )] ( #known-issues )
309+
310310* Variable labels coinciding with group variables may lead to unexpected formatting issues in the graph.
311311* Left-flushing of annotations relies on the ` monospace ` font.
312+ * Plot may give strange behavior for few rows of data (six rows or fewer. [ see this issue] ( https://github.com/LSYS/forestplot/issues/52 ) )
312313* Plot can get cluttered with too many variables/rows (~ 30 onwards)
313314<p align =" right " >(<a href =" #top " >back to top</a >)</p >
314315
0 commit comments