Skip to content

Commit

Permalink
Fix padding for data w/ 6 (or fewer) rows (resolves #52)
Browse files Browse the repository at this point in the history
Mentioned colab as known issue (closes #110)
  • Loading branch information
LSYS committed Jul 28, 2024
1 parent 04b8858 commit 075f88f
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 62 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ More fined-grained control for base plot options (eg font sizes, marker colors)
* Left-flushing of annotations relies on the `monospace` font.
* Plot may give strange behavior for few rows of data (six rows or fewer. [see this issue](https://github.com/LSYS/forestplot/issues/52))
* Plot can get cluttered with too many variables/rows (~30 onwards)
* Not tested with PyCharm (#80).
* Not tested with PyCharm (#80) nor Google Colab (#110).
* Duplicated `varlabel` may lead to unexpected results (see #76, #81). `mplot` for grouped models could be useful for such cases (see #59, WIP).
<p align="right">(<a href="#top">back to top</a>)</p>

Expand All @@ -378,7 +378,7 @@ This layout is similar to coefficient plots ([coefplots](http://repec.sowi.unibe

<details><summary><i>More resources about forest plots</i></summary><p>

* [[1]](https://doi.org/10.1038/s41433-021-01867-6) Chang, Y., Phillips, M.R., Guymer, R.H. et al. The 5min meta-analysis: understanding how to read and interpret a forest plot. Eye 36, 673–675 (2022).
* [[1]](https://doi.org/10.1038/s41433-021-01867-6) Chang, Y., Phillips, M.R., Guymer, R.H. et al. The 5 min meta-analysis: understanding how to read and interpret a forest plot. Eye 36, 673–675 (2022).
* [[2]](https://doi.org/10.1136/bmj.322.7300.1479) Lewis S, Clarke M. Forest plots: trying to see the wood and the trees BMJ 2001; 322 :1479
</p></details><p></p>

Expand Down Expand Up @@ -419,7 +419,7 @@ Contributions are welcome, and they are greatly appreciated!
**Issues**

Please submit bugs, questions, or issues you encounter to the [GitHub Issue Tracker](https://github.com/lsys/forestplot/issues).
For bugs, please provide a minimal reproducible example demonstrating the problem.
For bugs, please provide a minimal reproducible example demonstrating the problem (it may help me troubleshoot if I have a version of your data).

**Pull Requests**

Expand Down
56 changes: 28 additions & 28 deletions examples/readme-examples.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion forestplot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""State version and import user-facing functions."""
VERSION = (0, 4, 0)
VERSION = (0, 4, 1)

__version__ = ".".join(map(str, VERSION))

Expand Down
5 changes: 1 addition & 4 deletions forestplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,6 @@ def _make_forestplot(
right_annoteheaders=right_annoteheaders,
ax=ax,
)
if annoteheaders or right_annoteheaders:
negative_padding = 1.0
else:
negative_padding = 0.5
negative_padding = 0.5
ax.set_ylim(-0.5, ax.get_ylim()[1] - negative_padding)
return ax
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
install_requires = ["pandas", "numpy", "matplotlib", "matplotlib-inline<=0.1.3"]
setup(
name="forestplot",
version="0.4.0",
version="0.4.1",
license="MIT",
author="Lucas Shen",
author_email="lucas@lucasshen.com",
Expand Down
218 changes: 193 additions & 25 deletions tests/regressiontests.ipynb

Large diffs are not rendered by default.

0 comments on commit 075f88f

Please sign in to comment.