-
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
Not including first rows of dataset, row shifting, incorrectly annotating row as left-hand labels, whereas labels on the right are correct #81
Comments
The example code with the sleep dataset worked perfectly, however when I implemented my own dataset various mistakes arose. I hope someone has a solution for this? |
hi @rmaarle, thanks for raising this. I wasn't aware that duplicated variable labels ( Minimal example: import forestplot as fp
import pandas as pd
df = pd.read_csv("review_example.csv",sep=";") # companion example data
df = df.reset_index().astype({"index": str})
fp.forestplot(df, # the dataframe with results data
estimate='PCSA_Men_mean', # col containing estimated effect size
ll= 'PCSA_Men_Lower', hl='PCSA_Men_Upper', # columns containing conf. int. lower and higher limits
varlabel="index",
) Your case (main change is varlabel= import forestplot as fp
import pandas as pd
df = pd.read_csv("review_example.csv",sep=";") # companion example data
df = df.reset_index().astype({"index": str})
fp.forestplot(df, # the dataframe with results data
estimate='PCSA_Men_mean', # col containing estimated effect size
ll= 'PCSA_Men_Lower', hl='PCSA_Men_Upper', # columns containing conf. int. lower and higher limits
varlabel='index', # column containing variable label
capitalize="capitalize", # Capitalize labels
annote=["Source", "Image modality", 'Sample_size',"Method", 'Position'], # columns to report on left of plot
annoteheaders=["Ref", "Modality", 'N',"PCSA", 'Pose'], # ^corresponding headers
rightannote=['Age', 'Height', 'Weight', 'Fiber_length', 'Pennation',], # columns to report on right of plot
right_annoteheaders=['Age[y]', 'Height[cm]', 'Weight[kg]', 'Fiber_length[cm]', 'Pennation[Deg]'], #corresponding headers
groupvar= "Agegroup", # column containing group labels
group_order=["Reference","Young Adults","Adults"],
xlabel="PCSA Ratio", # x-label title
xticks=[0,30,60], # x-ticks to be printed
table=True, # Format as a table
color_alt_rows=True, # Gray alternate rows
# Additional kwargs for customizations
**{"marker": "D", # set maker symbol as diamond
"markersize": 35, # adjust marker size
"xtick_size": 12, # adjust x-ticker fontsize
}
) |
Your use case may find the future release (WIP) with grouped labels useful. The duplicated variable labels you were using were really groups. See #59 for an example. |
The next release will also warn about duplicated labels in the readme. |
review_example.csv
The text was updated successfully, but these errors were encountered: