def plot_efd(coeffs, locus=(<NUM_LIT:0.>, <NUM_LIT:0.>), image=None, contour=None, n=<NUM_LIT>):
try:<EOL><INDENT>import matplotlib.pyplot as plt<EOL><DEDENT>except ImportError:<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT>N = coeffs.shape[<NUM_LIT:0>]<EOL>N_half = int(np.ceil(N / <NUM_LIT:2>))<EOL>n_rows = <NUM_LIT:2><EOL>t = np.linspace(<NUM_LIT:0>, <NUM_LIT:1.0>, n)<EOL>xt = np.ones((n,)) * locus[<NUM_LIT:0>]<EOL>yt = np.ones((n,)) * locus[<NUM_LIT:1>]<EOL>for n in _range(coeffs.shape[<NUM_LIT:0>]):<EOL><INDENT>xt += (coeffs[n, <NUM_LIT:0>] * np.cos(<NUM_LIT:2> * (n + <NUM_LIT:1>) * np.pi * t)) +(coeffs[n, <NUM_LIT:1>] * np.sin(<NUM_LIT:2> * (n + <NUM_LIT:1>) * np.pi * t))<EOL>yt += (coeffs[n, <NUM_LIT:2>] * np.cos(<NUM_LIT:2> * (n + <NUM_LIT:1>) * np.pi * t)) +(coeffs[n, <NUM_LIT:3>] * np.sin(<NUM_LIT:2> * (n + <NUM_LIT:1>) * np.pi * t))<EOL>ax = plt.subplot2grid((n_rows, N_half), (n // N_half, n % N_half))<EOL>ax.set_title(str(n + <NUM_LIT:1>))<EOL>if contour is not None:<EOL><INDENT>ax.plot(contour[:, <NUM_LIT:1>], contour[:, <NUM_LIT:0>], '<STR_LIT>', linewidth=<NUM_LIT:2>)<EOL><DEDENT>ax.plot(yt, xt, '<STR_LIT:r>', linewidth=<NUM_LIT:2>)<EOL>if image is not None:<EOL><INDENT>ax.imshow(image, plt.cm.gray)<EOL><DEDENT><DEDENT>plt.show()<EOL>
Plot a ``[2 x (N / 2)]`` grid of successive truncations of the series.

    .. note::

        Requires `matplotlib <http://matplotlib.org/>`_!

    :param numpy.ndarray coeffs: ``[N x 4]`` Fourier coefficient array.
    :param list, tuple or numpy.ndarray locus:
        The :math:`A_0` and :math:`C_0` elliptic locus in [#a]_ and [#b]_.
    :param int n: Number of points to use for plotting of Fourier series.