def plot_vector(t, v, xlabel='', ylabel='', title=''):
    ' Plots a vector or time series.\n\n    Parameters\n    ----------\n    v: ndarray, ndims = 1/2\n        Vector or time series to plot\n    xlabel: str\n        x axis label\n    ylabel: str\n        y axis label\n    title: str\n        plot title\n\n    Raises\n    ------\n    ValueError\n        If dimensions of v are greater than 2\n    '
    if (v.ndim > 2):
        raise ValueError('v must be a vector or a time series')
    if (v.ndim == 1):
        x = list(range(len(v)))
        y = v
    else:
        x = v[:, 0]
        y = v[:, 1]
    plt.plot(t, v)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)
    plt.title(title)
    plt.show()
Plots a vector or time series.

Parameters
----------
v: ndarray, ndims = 1/2
    Vector or time series to plot
xlabel: str
    x axis label
ylabel: str
    y axis label
title: str
    plot title

Raises
------
ValueError
    If dimensions of v are greater than 2
def plot_vector(t, v, xlabel=, ylabel=, title=):
    ' Plots a vector or time series.\n\n    Parameters\n    ----------\n    v: ndarray, ndims = 1/2\n        Vector or time series to plot\n    xlabel: str\n        x axis label\n    ylabel: str\n        y axis label\n    title: str\n        plot title\n\n    Raises\n    ------\n    ValueError\n        If dimensions of v are greater than 2\n    '
    if (v.ndim > 2):
        raise ValueError('v must be a vector or a time series')
    if (v.ndim == 1):
        x = list(range(len(v)))
        y = v
    else:
        x = v[:, 0]
        y = v[:, 1]
    plt.plot(t, v)
    plt.xlabel(xlabel)
    plt.ylabel(ylabel)
    plt.title(title)
    plt.show()