Open jdoiii opened 4 months ago
+1 for this. It looks like when the grouping is done to plot the point estimates and CIs, that new row ordering is not tracked and the labels are placed in the order they are in the dataframe?:
ax.set_yticklabels(
dataframe[yticklabel], fontfamily=fontfamily, fontsize=fontsize, ha="left"
)
Issue: mforestplots do not correspond to (correct) forestplots
Background: I have data for unadjusted and adjusted odds ratios with confidence intervals.
I plot the same data using both forestplot (with repeated variable lables) and mforestplot.
With forestplot, the symbols have the correct ORs and CIs, although order of the variable labels is not consistent within groups.
However with mforestplot, the symbols do not consistently align with the correct labels.
For example: Symbols in Age and Comorbidity groups no longer match the correct label values in forestplot (e.g., Age4 ORs should both be < 1, Obesity ORs should both be > 1) . Sex, Race, Rank, and Status groups correctly match.
The code is the same except fp.mforestplot is used in place of fp.forestplot.
Questions:
Thanks in advance for any guidance.
FORESTPLOT
MFORESTPLOT
(UPDATE: corrected minor typo in code)