-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: support facet plot in py-maidr using maidr-ts #148
base: main
Are you sure you want to change the base?
Conversation
…plotlib and seaborn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for facet plots in py-maidr using the maidr-ts engine and adds several example scripts demonstrating facet plotting with both matplotlib and seaborn. Key changes include:
- New example scripts for facet plotting with matplotlib and seaborn, including combined bar and line plots.
- Updates to extractor mixins and plotting modules to improve shared label extraction and data processing for bar and line plots.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
example/facet-subplots/matplotlib/example_mpl_facet_bar_plot.py | Adds an example of a matplotlib facet bar plot |
example/facet-subplots/seaborn/example_sns_facet_combined_plot.py | Adds an example of a combined seaborn facet plot for sales and profit trends |
example/facet-subplots/seaborn/example_sns_facet_bar_plot.py | Implements a simple facet bar plot example using seaborn |
example/facet-subplots/matplotlib/example_mpl_facet_combined_plot.py | Adds a matplotlib example combining line and bar plots in facets |
maidr/util/mixin/extractor_mixin.py | Enhances tick label extraction by adding a fallback for shared x-axes |
maidr/core/plot/barplot.py | Adjusts handling of bar container data and label mismatches |
maidr/core/plot/maidr_plot.py | Introduces shared xlabel extraction to improve axis labeling consistency |
maidr/core/plot/lineplot.py | Filters out default line labels for clearer plot annotations |
Comments suppressed due to low confidence (2)
maidr/core/plot/barplot.py:71
- The commented-out length check between plot elements and their labels may mask data mismatches. Consider either removing the commented code entirely if it is no longer needed or refining the check to ensure that the number of patches always aligns with the extracted labels.
if len(plot) != len(level):
maidr/core/plot/lineplot.py:96
- Using the hardcoded string "_child0" as a filter for default labels is brittle. Consider extracting this magic string into a well-named constant to improve maintainability and clarity.
line.get_label() if line.get_label() != "_child0" else ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@dakshpokar Let's merge this PR once you implement seaborn support and its example. |
Sure Professor @jooyoungseo! |
Description
Note: This doesn't support Seaborn's FacetGrid construction of the plot yet.
Type of Change
Checklist