Skip to content

Not including first rows of dataset, row shifting, incorrectly annotating row as left-hand labels, whereas labels on the right are correct #81

Description

@rmaarle

review_example.csv
plot

import forestplot as fp
import pandas as pd

df = pd.read_csv("review_example.csv",sep=";")  # companion example data


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='Abbreviation',  # 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', "Info"],  # columns to report on right of plot 
              right_annoteheaders=['Age[y]', 'Height[cm]', 'Weight[kg]', 'Fiber_length[cm]', 'Pennation[Deg]', "Note"],  #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
                })
#plt.savefig("plot.jpg", bbox_inches="tight")

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