-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plot hides left hand side with variable names and confidence intervals #38
Comments
Same thing happens when I run the example df = fp.load_data("sleep") # companion example data fp.forestplot(df, # the dataframe with results data |
@LoveNordling Thanks for opening this issue. Seems related to #37. Can you confirm that you are using import matplotlib_inline
matplotlib_inline.__version__ If so, the solution is likely to freeze pip install "matplotlib-inline<=0.1.3" |
@LSYS Thank you for the reply! The version was 0.1.6. I have installed 0.1.3 now but it did not make a difference. ('matplotlib_inline' has no attribute 'version' but I used pip show matplotlib-inline to see the version) |
Strange, I can't reproduce it on |
I'm not using a notebook. Just python with a virtual environment on ubuntu 20. I'm using those versions for matplotlib and inline. This is how I save the figure fig = fp.forestplot(data, estimate="c", ll="lower", hl="upper", varlabel="name") |
I see, so Also, part of the issue was that the savefig line should probably be plt.savefig("debug.png", bbox_inches="tight") |
Using tight bbox_inches seems to have worked perfectly. Thank you very much for the help! Great and useful package! |
When running the following code I get a plot without variable names and confidence intervals. I'm using running matplotlib 3.6.2, numpy 1.22.4 and pandas 1.5.1
`import csv
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import forestplot as fp
N = 10
ids = ["Number is: " + str(x) for x in range(N) ]
coef = np.random.uniform(0.4,2, size=N)
lower = coef - np.random.uniform(size=N)
upper = coef + np.random.uniform(size=N)
data = pd.DataFrame({"c":coef, "lower": lower, "upper": upper, "name": ids})
fig = fp.forestplot(data, estimate="c", ll="lower", hl="upper", varlabel="name")
plt.savefig("debug.png")`
The text was updated successfully, but these errors were encountered: