Repository: matplotlib/matplotlib
File: lib/matplotlib/rcsetup.py (Python)

Code before:

    "grid.minor.color":        validate_color_or_None,  # grid color
    "grid.minor.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.minor.linewidth":    validate_float_or_None,     # in points
    "grid.minor.alpha":        validate_float_or_None,

    "grid.xaxis.major.color":        validate_color_or_None,  # grid color
    "grid.xaxis.major.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.xaxis.major.linewidth":    validate_float_or_None,     # in points
    "grid.xaxis.major.alpha":        validate_float_or_None,

    "grid.xaxis.minor.color":        validate_color_or_None,  # grid color
    "grid.xaxis.minor.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.xaxis.minor.linewidth":    validate_float_or_None,     # in points
    "grid.xaxis.minor.alpha":        validate_float_or_None,

    "grid.yaxis.major.color":        validate_color_or_None,  # grid color
    "grid.yaxis.major.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.yaxis.major.linewidth":    validate_float_or_None,     # in points
    "grid.yaxis.major.alpha":        validate_float_or_None,

    "grid.yaxis.minor.color":        validate_color_or_None,  # grid color
    "grid.yaxis.minor.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.yaxis.minor.linewidth":    validate_float_or_None,     # in points
    "grid.yaxis.minor.alpha":        validate_float_or_None,

    ## figure props
    # figure title
    "figure.titlesize":   validate_fontsize,
    "figure.titleweight": validate_fontweight,

    # figure labels
    "figure.labelsize":   validate_fontsize,
    "figure.labelweight": validate_fontweight,

    # figure size in inches: width by height
    "figure.figsize":          _listify_validator(validate_float, n=2),
    "figure.dpi":              validate_float,
    "figure.facecolor":        validate_color,
    "figure.edgecolor":        validate_color,
    "figure.frameon":          validate_bool,
    "figure.autolayout":       validate_bool,
    "figure.max_open_warning": validate_int,
    "figure.raise_window":     validate_bool,
    "macosx.window_mode":      ["system", "tab", "window"],

    "figure.subplot.left":   validate_float,
    "figure.subplot.right":  validate_float,
    "figure.subplot.bottom": validate_float,
    "figure.subplot.top":    validate_float,
    "figure.subplot.wspace": validate_float,

Review comment (bug):
Seeing this in code, it feels a bit too much. I've browsed though a lot of plots and didn't find relevant usage. If the grids are different on x and y, it's typically that only one of them is activated. I've not seen the case that people use different styles for x and y.

Therefore I revert my previous proposal and think we should leave this out (YAGNI). Sorry for the back-and-forth, but sometimes one has to go the step to see it was wrong. On the plus side, this interplay lead to the expansion of `_val_or_rc()` which I think is a real win.



Code after:
        "center", "top", "bottom", "baseline", "center_baseline"],

    "grid.color":        validate_color,  # grid color
    "grid.linestyle":    _validate_linestyle,  # solid
    "grid.linewidth":    validate_float,     # in points
    "grid.alpha":        validate_float,

    "grid.major.color":        _validate_color_or_None,  # grid color
    "grid.major.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.major.linewidth":    validate_float_or_None,     # in points
    "grid.major.alpha":        validate_float_or_None,

    "grid.minor.color":        _validate_color_or_None,  # grid color
    "grid.minor.linestyle":    _validate_linestyle_or_None,  # solid
    "grid.minor.linewidth":    validate_float_or_None,     # in points
    "grid.minor.alpha":        validate_float_or_None,

    ## figure props
    # figure title
    "figure.titlesize":   validate_fontsize,
    "figure.titleweight": validate_fontweight,

    # figure labels
    "figure.labelsize":   validate_fontsize,
    "figure.labelweight": validate_fontweight,

    # figure size in inches: width by height
    "figure.figsize":          _listify_validator(validate_float, n=2),
    "figure.dpi":              validate_float,
    "figure.facecolor":        validate_color,
    "figure.edgecolor":        validate_color,
    "figure.frameon":          validate_bool,
    "figure.autolayout":       validate_bool,
    "figure.max_open_warning": validate_int,
    "figure.raise_window":     validate_bool,
    "macosx.window_mode":      ["system", "tab", "window"],

    "figure.subplot.left":   validate_float,
    "figure.subplot.right":  validate_float,
    "figure.subplot.bottom": validate_float,
    "figure.subplot.top":    validate_float,
    "figure.subplot.wspace": validate_float,
    "figure.subplot.hspace": validate_float,

    "figure.constrained_layout.use": validate_bool,  # run constrained_layout?
    # wspace and hspace are fraction of adjacent subplots to use for space.
    # Much smaller than above because we don't need room for the text.
    "figure.constrained_layout.hspace": validate_float,
    "figure.constrained_layout.wspace": validate_float,
    # buffer around the Axes, in inches.
    "figure.constrained_layout.h_pad": validate_float,