def edit_title(ax, text, prepend=False, append=False):
    """
    Adds text to beginning or end of existing title on axes

    Args:
        ax (plt.Axes): Axes with title to edit
        text (str): Text to add to beginning or end of title
        prepend (bool): Prepend text (can't do both at same time)
        append (bool): Append text (can't do both at same time)

    Returns:
        plt.Axes: ax adjusted
    """
    assert prepend ^ append  # Assert 1 and only 1 is True
    t = ax.title.get_text()
    if prepend:
        ax.title.set_text(f'{text}{t}')
    elif append:
        ax.title.set_text(f'{t}{text}')
    else:
        raise NotImplementedError
    return ax