Skip to content

Commit

Permalink
Update readme for mplot (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
LSYS committed Jan 21, 2024
1 parent f2d8912 commit 6c61c27
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 78 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ fp.forestplot(df, # the dataframe with results data
<!------------------- Multi-models ------------------->
## Multi-models[![](https://raw.githubusercontent.com/LSYS/forestplot/main/docs/images/pin.svg)](#multi-models)

For coefficient plots where each variable can have multiple estimates (each `model` has one).

```python
import forestplot as fp

Expand Down Expand Up @@ -293,15 +295,18 @@ fp.mforestplot(
xlabel="Coefficient (95% CI)",
modellabels=["Have young kids", "Full sample"],
xticks=[-1200, -600, 0, 600],
mcolor=["#CC6677", "#4477AA"],
# Additional kwargs for customizations
**{
"markersize": 30,
# override default vertical space between models
"offset": 0.4,
# override default vertical offset between models (0.0 to 1.0)
"offset": 0.35,
"xlinestyle": (0, (10, 5)), # long dash for x-reference line
"xlinecolor": ".8", # gray color for x-reference line
},
)
```
<p align="left"><img width="80%" src="https://raw.githubusercontent.com/LSYS/forestplot/mplot-dev/docs/images/multimodel.png"></p>
<p align="left"><img width="100%" src="https://raw.githubusercontent.com/LSYS/forestplot/mplot-dev/docs/images/multimodel.png"></p>

Please note: This module is still experimental. See [this jupyter notebook](https://nbviewer.org/github/LSYS/forestplot/blob/mplot-dev/examples/test-multmodel-sleep.ipynb) for more examples and tweaks.

Expand Down
96 changes: 22 additions & 74 deletions examples/readme-examples.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/test-multmodel-sleep.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@
"id": "a66d80ba",
"metadata": {},
"source": [
"## Moneyshot"
"## Camera ready"
]
},
{
Expand Down

0 comments on commit 6c61c27

Please sign in to comment.