def lag_plot(data, lag=<NUM_LIT:1>, kind="<STR_LIT>", **kwds):
if lag != int(lag) or int(lag) <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>lag = int(lag)<EOL>values = data.values<EOL>y1 = "<STR_LIT>"<EOL>y2 = "<STR_LIT>".format(lag)<EOL>lags = pd.DataFrame({y1: values[:-lag].T.ravel(), y2: values[lag:].T.ravel()})<EOL>if isinstance(data, pd.DataFrame):<EOL><INDENT>lags["<STR_LIT>"] = np.repeat(data.columns, lags.shape[<NUM_LIT:0>] / data.shape[<NUM_LIT:1>])<EOL>kwds["<STR_LIT:c>"] = "<STR_LIT>"<EOL><DEDENT>return lags.vgplot(kind=kind, x=y1, y=y2, **kwds)<EOL>
Lag plot for time series.

    Parameters
    ----------
    data: pandas.Series
        the time series to plot
    lag: integer
        The lag of the scatter plot, default=1
    kind: string
        The kind of plot to use (e.g. 'scatter', 'line')
    **kwds:
        Additional keywords passed to data.vgplot.scatter

    Returns
    -------
    chart: alt.Chart object