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

Code before:
        Add check buttons to `~.axes.Axes` instance *ax*.

        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The parent Axes for the widget.
        labels : list of str
            The labels of the check buttons.
        actives : list of bool, optional
            The initial check states of the buttons. The list must have the
            same length as *labels*. If not given, all buttons are unchecked.
        layout : None or "vertical" or "horizontal" or (int, int), default: None
            The layout of the check buttons. Options are:

            - ``None``: Use legacy vertical layout (default).
            - ``"vertical"``: Arrange buttons in a single column with
              dynamic positioning based on text widths.
            - ``"horizontal"``: Arrange buttons in a single row with
              dynamic positioning based on text widths.
            - ``(rows, cols)`` tuple: Arrange buttons in a grid with the
              specified number of rows and columns. Buttons are placed
              left-to-right, top-to-bottom with dynamic positioning.

            The layout options "vertical", "horizontal" and ``(rows, cols)``
            create ``mtext.Text`` objects to determine exact text sizes, and
            then they are added axes. This is usually ok, but may cause
            side-effects and has a slight performance impact. Therefore the
            default ``None`` value avoids this.

            .. admonition:: Provisional
                The new layout options are provisional. Their algorithmic
                behavior, including the exact positions of buttons and labels
                may still change without prior warning.

            .. versionadded:: 3.11
        useblit : bool, default: True
            Use blitting for faster drawing if supported by the backend.
            See the tutorial :ref:`blitting` for details.

            .. versionadded:: 3.7

        label_props : dict of lists, optional
            Dictionary of `.Text` properties to be used for the labels. Each
            dictionary value should be a list of at least a single element. If
            the list is of length M, its values are cycled such that the Nth
            label gets the (N mod M) property.

            .. versionadded:: 3.7
        frame_props : dict, optional
            Dictionary of scatter `.Collection` properties to be used for the
            check button frame. Defaults (label font size / 2)**2 size, black

Review comment (suggestion):
```suggestion
            then they are added to the Axes. This is usually okay, but may cause
```

Code after:
        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The parent Axes for the widget.
        labels : list of str
            The labels of the check buttons.
        actives : list of bool, optional
            The initial check states of the buttons. The list must have the
            same length as *labels*. If not given, all buttons are unchecked.
        layout : None or "vertical" or "horizontal" or (int, int), default: None
            The layout of the check buttons. Options are:

            - ``None``: Use legacy vertical layout (default).
            - ``"vertical"``: Arrange buttons in a single column with
              dynamic positioning based on text widths.
            - ``"horizontal"``: Arrange buttons in a single row with
              dynamic positioning based on text widths.
            - ``(rows, cols)`` tuple: Arrange buttons in a grid with the
              specified number of rows and columns. Buttons are placed
              left-to-right, top-to-bottom with dynamic positioning.

            The layout options "vertical", "horizontal" and ``(rows, cols)``
            create ``mtext.Text`` objects to determine exact text sizes, and
            then they are added to the Axes. This is usually okay, but may cause
            side-effects and has a slight performance impact. Therefore the
            default ``None`` value avoids this.

            .. admonition:: Provisional
                The new layout options are provisional. Their algorithmic
                behavior, including the exact positions of buttons and labels,
                may still change without prior warning.

            .. versionadded:: 3.11
        useblit : bool, default: True
            Use blitting for faster drawing if supported by the backend.
            See the tutorial :ref:`blitting` for details.

            .. versionadded:: 3.7

        label_props : dict of lists, optional
            Dictionary of `.Text` properties to be used for the labels. Each
            dictionary value should be a list of at least a single element. If
            the list is of length M, its values are cycled such that the Nth
            label gets the (N mod M) property.

            .. versionadded:: 3.7
        frame_props : dict, optional
            Dictionary of scatter `.Collection` properties to be used for the
            check button frame. Defaults (label font size / 2)**2 size, black
            edgecolor, no facecolor, and 1.0 linewidth.