@unavailable((not _has_matplotlib), 'matplotlib')
def plot_ellipsoid_2D(p, q, ax, n_points=100, color='r'):
    ' Plot an ellipsoid in 2D\n\n    TODO: Untested!\n\n    Parameters\n    ----------\n    p: 3x1 array[float]\n        Center of the ellipsoid\n    q: 3x3 array[float]\n        Shape matrix of the ellipsoid\n    ax: matplotlib.Axes object\n        Ax on which to plot the ellipsoid\n\n    Returns\n    -------\n    ax: matplotlib.Axes object\n        The Ax containing the ellipsoid\n    '
    plt.sca(ax)
    r = nLa.cholesky(q).T
    t = np.linspace(0, (2 * np.pi), n_points)
    z = [np.cos(t), np.sin(t)]
    ellipse = (np.dot(r, z) + p)
    (handle,) = ax.plot(ellipse[0, :], ellipse[1, :], color)
    return (ax, handle)
Plot an ellipsoid in 2D

TODO: Untested!

Parameters
----------
p: 3x1 array[float]
    Center of the ellipsoid
q: 3x3 array[float]
    Shape matrix of the ellipsoid
ax: matplotlib.Axes object
    Ax on which to plot the ellipsoid

Returns
-------
ax: matplotlib.Axes object
    The Ax containing the ellipsoid
@unavailable((not _has_matplotlib), 'matplotlib')
def plot_ellipsoid_2D(p, q, ax, n_points=100, color='r'):
    ' Plot an ellipsoid in 2D\n\n    TODO: Untested!\n\n    Parameters\n    ----------\n    p: 3x1 array[float]\n        Center of the ellipsoid\n    q: 3x3 array[float]\n        Shape matrix of the ellipsoid\n    ax: matplotlib.Axes object\n        Ax on which to plot the ellipsoid\n\n    Returns\n    -------\n    ax: matplotlib.Axes object\n        The Ax containing the ellipsoid\n    '
    plt.sca(ax)
    r = nLa.cholesky(q).T
    t = np.linspace(0, (2 * np.pi), n_points)
    z = [np.cos(t), np.sin(t)]
    ellipse = (np.dot(r, z) + p)
    (handle,) = ax.plot(ellipse[0, :], ellipse[1, :], color)
    return (ax, handle)