You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNT]: DISCUSSION: Should Axes.grouped_bar() enforce hatch list length or allow cycling like colors? #30712
Should Axes.grouped_bar() enforce the hatch list length to match the number of datasets,
or should it allow automatic cycling, consistent with colors and other style arguments?
If we decide that hatch should enforce length,
should other style arguments (colors, linestyles, markers, etc.)
also be updated in the future for consistency —
or should the broader design direction remain permissive and cycling-based?
Arguments for cycling (current behavior)
Consistency: Aligns with colors, linestyles, and markers, maintaining familiar user expectations.
Flexibility: Shorter lists still produce usable plots without errors.
User-friendly: Avoids unnecessary exceptions in exploratory or educational workflows.
Backward-compatible: Keeps consistent with historical behavior in most Matplotlib APIs.
Arguments for enforcing
Explicitness: Detects mistakes when users intend unique styles per dataset.
Clarity: Prevents silent repetition of hatches that could cause visual confusion.
Predictability: Ensures a clear 1:1 mapping between datasets and style definitions.
Request for feedback
Before finalizing the implementation, feedback is requested on:
Preferred default behavior (cycle vs enforce)
Whether the decision should apply only to hatches or be standardized across all style arguments
Potential implications for the public API and documentation (e.g., user expectations, legend consistency)
@ilakkmanoharan What is the intended scope of this discussion? For a short-term grouped_bar() implementation, I've answered the question already [here](#30683 (comment).
If you plan on opening the general discussion, please reflect that in title and discussion proposal.
@ilakkmanoharan no you are missing the point: If you want to discuss hatching specific to grouped_bar in your PR, do so there (but I've already given the answer there). If you want to start a general discussion on enforcing length checks of parameter lists, that's a discussion for a dedicated issue, but then indidcate that it's a general topic, and certainly neither grouped_bar() no hatch should be in focus / in the title. They are merely on of many applications of the pattern.
Activity
timhoffm commentedon Nov 2, 2025
@ilakkmanoharan What is the intended scope of this discussion? For a short-term
grouped_bar()implementation, I've answered the question already [here](#30683 (comment).If you plan on opening the general discussion, please reflect that in title and discussion proposal.
ilakkmanoharan commentedon Nov 5, 2025
@timhoffm
I have added '[MNT]: DISCUSSION:' in the title.
Are you saying this issue should be a feature request?
jklymak commentedon Nov 5, 2025
Let's close this. Please discuss in the comments on the PR.
timhoffm commentedon Nov 5, 2025
@ilakkmanoharan no you are missing the point: If you want to discuss hatching specific to grouped_bar in your PR, do so there (but I've already given the answer there). If you want to start a general discussion on enforcing length checks of parameter lists, that's a discussion for a dedicated issue, but then indidcate that it's a general topic, and certainly neither grouped_bar() no hatch should be in focus / in the title. They are merely on of many applications of the pattern.