def plot_contribution(ax, tau2, proj, comp_num=1):
    """
    Plot projection vs time for a specified component, return axes object.
    :param ax: axes object
    :param tau2: list of times, Z x 1 numpy array
    :param proj: projection of data onto components, Z x n_comp numpy array
    :param comp_num: component number to plot, default 1
    :return: axes object with scatter plot of projection vs time
    """
    buffer = tau2[-1][0]/100
    ax.plot([-buffer, tau2[-1] + buffer], [0, 0], c='black')  # zero line
    ax.scatter(tau2, proj[:, comp_num-1])
    ax.set_xlabel("Time (fs)", fontsize=14)
    ax.set_xlim(-buffer, tau2[-1] + buffer)
    ax.set_title("Component " + str(comp_num), fontsize=14)
    return ax