How to use the cplot.tripcolor function in cplot

To help you get started, we’ve selected a few cplot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nschloe / cplot / test / logo.py View on Github external
x = (radii * numpy.cos(angles)).flatten()
    y = (radii * numpy.sin(angles)).flatten()

    # Create the Triangulation; no triangles so Delaunay triangulation created.
    triang = tri.Triangulation(x, y)

    # print(triang)
    # exit(1)
    # import dmsh
    # geo = dmsh.Circle([0.0, 0.0], 1.0)
    # X, cells = dmsh.generate(geo, 0.1)

    z = x + 1j * y
    # z /= numpy.abs(z)

    cplot.tripcolor(triang, z, alpha=0)
    plt.gca().set_aspect("equal", "datalim")
    plt.axis("off")

    plt.savefig("logo.png", transparent=True)
    return
github nschloe / cplot / test / test_tripcolor.py View on Github external
angles[:, 1::2] += numpy.pi / n_angles

    x = (radii * numpy.cos(angles)).flatten()
    y = (radii * numpy.sin(angles)).flatten()
    z = 2 * (x + 1j * y)

    # Create the Triangulation; no triangles so Delaunay triangulation created.
    triang = tri.Triangulation(x, y)

    # Mask off unwanted triangles.
    triang.set_mask(
        numpy.hypot(x[triang.triangles].mean(axis=1), y[triang.triangles].mean(axis=1))
        < min_radius
    )

    cplot.tripcolor(triang, z)
    plt.gca().set_aspect("equal", "datalim")
    plt.show()
    return

cplot

Plot complex-valued functions

GPL-3.0
Latest version published 2 years ago

Package Health Score

39 / 100
Full package analysis