<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_sideplot( ax, along, pad=0., *, grid=True, zero_line=True, arrs_to_bin=None, normalize_bin=True, ymin=0, ymax=1.1, height=0.75, c="C0" ):
 """Add a sideplot to an axis. Sideplots share their corresponding axis. Parameters ax : matplotlib AxesSubplot object The axis to add a sideplot along. along : {'x', 'y'} The dimension to add a sideplot along. pad : number (optional) Distance between axis and sideplot. Default is 0. grid : bool (optional) Toggle for plotting grid on sideplot. Default is True. zero_line : bool (optional) Toggle for plotting black line at zero signal. Default is True. arrs_to_bin : list [xi, yi, zi] (optional) Bins are plotted if arrays are supplied. Default is None. normalize_bin : bool (optional) Normalize bin by max value. Default is True. ymin : number (optional) Bin minimum extent. Default is 0. ymax : number (optional) Bin maximum extent. Default is 1.1 c : string (optional) Line color. Default is C0. Returns ------- axCorr AxesSubplot object """

    # divider should only be created once
    if hasattr(ax, "WrightTools_sideplot_divider"):
        divider = ax.WrightTools_sideplot_divider
    else:
        divider = make_axes_locatable(ax)
        setattr(ax, "WrightTools_sideplot_divider", divider)
    # create sideplot axis
    if along == "x":
        axCorr = divider.append_axes("top", height, pad=pad, sharex=ax)
    elif along == "y":
        axCorr = divider.append_axes("right", height, pad=pad, sharey=ax)
    axCorr.autoscale(False)
    axCorr.set_adjustable("box")
    # bin
    if arrs_to_bin is not None:
        xi, yi, zi = arrs_to_bin
        if along == "x":
            b = np.nansum(zi, axis=0) * len(yi)
            if normalize_bin:
                b /= np.nanmax(b)
            axCorr.plot(xi, b, c=c, lw=2)
        elif along == "y":
            b = np.nansum(zi, axis=1) * len(xi)
            if normalize_bin:
                b /= np.nanmax(b)
            axCorr.plot(b, yi, c=c, lw=2)
    # beautify
    if along == "x":
        axCorr.set_ylim(ymin, ymax)
        axCorr.tick_params(axis="x", which="both", length=0)
    elif along == "y":
        axCorr.set_xlim(ymin, ymax)
        axCorr.tick_params(axis="y", which="both", length=0)
    plt.grid(grid)
    if zero_line:
        if along == "x":
            plt.axhline(0, c="k", lw=1)
        elif along == "y":
            plt.axvline(0, c="k", lw=1)
    plt.setp(axCorr.get_xticklabels(), visible=False)
    plt.setp(axCorr.get_yticklabels(), visible=False)
    return axCorr