Skip to content

[MNT]: DISCUSSION: Should Axes.grouped_bar() apply a default hatch pattern when none is provided? #30728

@ilakkmanoharan

Description

@ilakkmanoharan

Summary

Currently, when no hatch argument is passed to Axes.grouped_bar(), hatching is entirely disabled:

if hatch is None:
    # No hatch specified: disable hatching entirely by cycling [None].
    hatches = itertools.cycle([None])
    # TODO: Discussion —
    #   Should grouped_bar() apply a default hatch pattern (e.g., '//')
    #   when none is provided ?

This behavior matches the philosophy of “explicit is better than implicit,” keeping hatching opt-in.
However, there’s a possible usability question:
Should grouped_bar() automatically apply a default hatch pattern (for example '//') when multiple datasets are plotted, to help users visually distinguish bars even when colors are similar or when figures are printed in grayscale?

Discussion Points:

Would automatic hatching improve accessibility and readability (especially in black-and-white printing)?
Should the default depend on the number of datasets or color distinctness?

Follow-up to the Enh/Add hatch pattern support to Axes.grouped_bar #30726

Proposed fix

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions