Skip to content

Top of the plot gets cut off #47

Description

@sayadennis

Hello! Thank you for building this awesome package.

I'm trying to visualize some odds-ratios and their confidence intervals, and I'm running into an issue where the top of the plot seems to get cut off.

I installed forestplot today via conda with conda install -c conda-forge forestplot, and am running it on Python 3.9.6.

Data

>>> df
  varname        or       low      high
0       a  1.761471  0.926563  3.022285
1       b  1.443660  0.517059  3.130794
2       c  1.525227  0.603459  3.082003
3       d  0.895682  0.463703  1.660016
4       e  4.025670  1.196941  8.932753
5       f  1.086105  0.555171  2.045735

Plotting code

fp.forestplot(df,  # the dataframe with results data
    estimate='or',  # col containing estimated effect size 
    ll='low', hl='high',  # columns containing conf. int. lower and higher limits
    varlabel='varname',  # column containing variable label
    ylabel='Confidence interval',  # y-label title
    xlabel='Odds Ratio',  # x-label title
    color_alt_rows=True,
    figsize=(4,8),
    **{
        'xline' : 1.,
        "xlinestyle": (0, (10, 5)),  # long dash for x-reference line 
    }
)

plt.savefig('test_forest_plot.png', bbox_inches='tight')

What I'm seeing is the attached image, where the top of the plot (where variable "a" should be) is getting cut off. I've tried adjusting the plot size but the issue persists. Any insight or advice would be appreciated!

20230116_test_forest_plot

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions