def filter_plot_size(layout, basesize):
    """Return the size (in inches) of the plot produced by `plot_filters`

    Args:

        * layout (list of tuples): The result of a call to
          :func:`nnhealpix.visual.filter_plot_layout`

        * basesize (float): Size (in inches) to be used to plot each
          of the filters

    Returns:
        A 2-element tuple containing the width and height in inches of
        the plot.
    """

    nrows, ncols = len(layout), max(layout)

    # Each square containing a filter will be placed in a square
    # whose side is "basesize" inches long

    width = min(ncols * basesize, 12)
    height = nrows * basesize

    return width, height