def _create_axes_grid(length_plotters, rows, cols, **kwargs):
    """Create figure and axes for grids with multiple plots.

    Parameters
    ----------
    n_items : int
        Number of panels required
    rows : int
        Number of rows
    cols : int
        Number of columns

    Returns
    -------
    fig : matplotlib figure
    ax : matplotlib axes
    """
    kwargs.setdefault("constrained_layout", True)
    fig, ax = plt.subplots(rows, cols, **kwargs)
    ax = np.ravel(ax)
    extra = (rows * cols) - length_plotters
    if extra:
        for i in range(1, extra + 1):
            ax[-i].set_axis_off()
        ax = ax[:-extra]
    return fig, ax
def _create_axes_grid ( length_plotters , rows , cols , ** kwargs ) : kwargs . setdefault ( "constrained_layout" , True ) fig , ax = plt . subplots ( rows , cols , ** kwargs ) ax = np . ravel ( ax ) extra = ( rows * cols ) - length_plotters if extra : for i in range ( 1 , extra + 1 ) : ax [ - i ] . set_axis_off ( ) ax = ax [ : - extra ] return fig , ax
Create figure and axes for grids with multiple plots.

    Parameters
    ----------
    n_items : int
        Number of panels required
    rows : int
        Number of rows
    cols : int
        Number of columns

    Returns
    -------
    fig : matplotlib figure
    ax : matplotlib axes