Improve table-style forest plot rendering and subgroup support#122
Open
Improve table-style forest plot rendering and subgroup support#122
Conversation
determine ylim to actually reflect the number of rows needed to display the header, especially when there are few rows in the dataframe (e.g., 3 rows)
Handle dataframes with null values.
Add a parameter to enable drawing marker sizes proportional to study weights.
Let user specify which row(s) contains subtotal information, and draw a horizontal diamond to indicate the CI of the subtotal stats, rather than square&whiskers.
allows the user to specify stats of the total effect, and show underneath the total row.
ignore capitalization for rows containing subtotal stats and info
riginally, the y is specified as dataframe[yticklabel]. This works until there are duplicate values in the yticklabel column. In this case, pyplot skips the duplicated values without yielding any warning. When plotting, we should always specify numerical x-y coordinates!!!
enable consistent padding width across rendereres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Motivation
The main motivation was to make the package more reliable for dense, publication-style forest plots where:
In my use case, these issues became apparent when generating large batches of forest plots from structured meta-analysis data. In particular, relying on auto-generated y-ticks or inferred axis limits was fragile when headers, duplicate labels, or unusual annotation columns were present. My changes make row placement more explicit and deterministic, which substantially improves robustness for complex plots
Notes
Some of these changes were motivated by reproducing real-world Cochrane forest plots, including subgroup summaries and weighted study markers. The fixes around missing headers, row/tick mismatches, duplicate labels, empty-plot handling, weight-based marker sizing, subtotal diamonds, subtotal statistics, and out-of-range CI arrows all came directly from those use cases.