def _plot2d(vi, X, target='vanishing', n=1000, scale=1.5, x_max=1.0, y_max=1.0, show=False, splitshow=False):
    m = np.mean(X, axis=0)
    x_max = y_max = np.max(np.abs(X))
    x = np.linspace(((- scale) * x_max), (scale * x_max), 50)
    y = np.linspace(((- scale) * y_max), (scale * y_max), 50)
    (Z1, Z2) = np.meshgrid(x, y)
    npolys = 0
    if (target == 'vanishing'):
        npolys = sum([Bt.n_vanishings() for Bt in vi.basis])
    elif (target == 'nonvanishing'):
        npolys = sum([Bt.n_nonvanishings() for Bt in vi.basis])
    colors = plt.cm.Dark2(np.linspace(0, 1, 8))
    linestyles = ['solid', 'dashed', 'dashdot', 'dotted']
    nfigs = min(npolys, n)
    for i in range(nfigs):
        f = (lambda x_, y_: vi.evaluate(np.array([[x_, y_]]), target=target)[(0, i)])
        f = np.vectorize(f)
        plt.contour(Z1, Z2, f(Z1, Z2), levels=[0], colors=[colors[(i % len(colors))]], linewidths=[1.0], linestyles=[linestyles[(i % 4)]])
        if splitshow:
            plt.plot(X[:, 0], X[:, 1], 'o', mfc='none', alpha=0.8)
            plt.gca().set_aspect('equal', adjustable='box')
            plt.show()
    if (not splitshow):
        plt.plot(X[:, 0], X[:, 1], 'o', mfc='none', alpha=0.8)
        plt.gca().set_aspect('equal', adjustable='box')
    if ((not splitshow) and show):
        plt.show()
def _plot2d(vi, X, target='vanishing', n=1000, scale=1.5, x_max=1.0, y_max=1.0, show=False, splitshow=False):
    m = np.mean(X, axis=0)
    x_max = y_max = np.max(np.abs(X))
    x = np.linspace(((- scale) * x_max), (scale * x_max), 50)
    y = np.linspace(((- scale) * y_max), (scale * y_max), 50)
    (Z1, Z2) = np.meshgrid(x, y)
    npolys = 0
    if (target == 'vanishing'):
        npolys = sum([Bt.n_vanishings() for Bt in vi.basis])
    elif (target == 'nonvanishing'):
        npolys = sum([Bt.n_nonvanishings() for Bt in vi.basis])
    colors = plt.cm.Dark2(np.linspace(0, 1, 8))
    linestyles = ['solid', 'dashed', 'dashdot', 'dotted']
    nfigs = min(npolys, n)
    for i in range(nfigs):
        f = (lambda x_, y_: vi.evaluate(np.array([[x_, y_]]), target=target)[(0, i)])
        f = np.vectorize(f)
        plt.contour(Z1, Z2, f(Z1, Z2), levels=[0], colors=[colors[(i % len(colors))]], linewidths=[1.0], linestyles=[linestyles[(i % 4)]])
        if splitshow:
            plt.plot(X[:, 0], X[:, 1], 'o', mfc='none', alpha=0.8)
            plt.gca().set_aspect('equal', adjustable='box')
            plt.show()
    if (not splitshow):
        plt.plot(X[:, 0], X[:, 1], 'o', mfc='none', alpha=0.8)
        plt.gca().set_aspect('equal', adjustable='box')
    if ((not splitshow) and show):
        plt.show()