Skip to content

Commit

Permalink
Add option to remove mplot legend (#103)
Browse files Browse the repository at this point in the history
* Add option to remove mplot legend

* Pleasing linters
  • Loading branch information
LSYS authored Jan 15, 2024
1 parent f866b20 commit f822f4d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion forestplot/mplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def mforestplot(
return_df: bool = False,
preprocess: bool = True,
table: bool = False,
legend: bool = True,
**kwargs: Any,
) -> Axes:
"""
Expand Down Expand Up @@ -197,6 +198,7 @@ def mforestplot(
yticker2=yticker2,
color_alt_rows=color_alt_rows,
table=table,
legend=legend,
**kwargs,
)
if return_df:
Expand Down Expand Up @@ -309,6 +311,7 @@ def _make_mforestplot(
despine: bool = True,
color_alt_rows: bool = False,
table: bool = False,
legend: bool = True,
**kwargs: Any,
) -> Axes:
if models is None:
Expand Down Expand Up @@ -339,7 +342,10 @@ def _make_mforestplot(
ax=ax,
**kwargs,
)
ax = mdraw_legend(models=models, modellabels=modellabels, ax=ax, xlabel=xlabel, **kwargs)
if legend:
ax = mdraw_legend(
models=models, modellabels=modellabels, ax=ax, xlabel=xlabel, **kwargs
)

format_xticks(
dataframe=dataframe, estimate=estimate, ll=ll, hl=hl, xticks=xticks, ax=ax, **kwargs
Expand Down

0 comments on commit f822f4d

Please sign in to comment.