forestplot icon indicating copy to clipboard operation
forestplot copied to clipboard

Changing the line color indicating statistical significance

Open juancq opened this issue 2 years ago • 6 comments

Great package!

Where in the code should I look if I want to modify the plotting so that I can change the color of a line when the corresponding row is statistically significant? I don't want to show the p-values or the stars, I just want to change the line color.

juancq avatar Mar 27 '23 08:03 juancq

Hi @juancq, thank you for using the package! Do you mean the color of the confidence interval lines? Those would be from the linecolor kwarg

https://github.com/LSYS/forestplot/blob/30f1eef6ae64fc9145af2b4ab94f4fd25a71375b/forestplot/graph_utils.py#L48 and https://github.com/LSYS/forestplot/blob/30f1eef6ae64fc9145af2b4ab94f4fd25a71375b/forestplot/graph_utils.py#L53

But off the top of my mind I'm not sure how easy it would be change colors just for selected rows. I'm using the errorbar API to draw the confidence intervals (https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.errorbar.html)

LSYS avatar Mar 31 '23 07:03 LSYS

I'll play around with the code and see if there's an easy way to implement it.

juancq avatar Apr 03 '23 07:04 juancq

Hello, is there anyway to change the reference line from 0 to 1? I am using odds ratios so i would like a different reference line

Katharinebarry avatar Mar 01 '24 15:03 Katharinebarry

i try to use the logscale option and receive many errors

Katharinebarry avatar Mar 01 '24 15:03 Katharinebarry

Hi @Katharinebarry, this has been raised before. See #77. Use the "xline": 1 option. For errors, showing some reproducible example would help.

LSYS avatar Mar 03 '24 04:03 LSYS

Thank you so much worked like a charm!

Katharinebarry avatar Mar 04 '24 08:03 Katharinebarry