def plotwidth(figure, nrows, ncols):
    """Calculate the plot width of the figure, assuming square subplots.

    Does this by calculating the height per plot and multiplying by number of
    columns.
    """
    height = figure.get_figheight() / nrows
    return height * ncols