Scalar Quantities

Visualize scalar valued data at the nodes or edges of a curve network.

Example:

import numpy as np
import polyscope as ps
ps.init()

# register a curve network
N_node = 100
N_edge = 250
nodes = np.random.rand(N_node, 3)
edges = np.random.randint(0, N_node, size=(N_edge,2))
ps_net = ps.register_curve_network("my network", nodes, edges)

# visualize some random data per-node
vals_node = np.random.rand(N_node)

# visualize some random data per-edge
vals_edge = np.random.rand(N_edge)

# as always, we can customize the initial appearance
enabled=True, vminmax=(-3., 3.), cmap='reds')

# view the network with all of these quantities
ps.show()


CurveNetwork.add_scalar_quantity(name, values, defined_on='nodes', enabled=None, datatype="standard", vminmax=None, cmap=None)

Add a scalar quantity to the network.

• name string, a name for the quantity
• values a length N numpy array, scalars at nodes/edges
• defined_on string, one of nodes or edges, is this data a value per-node or a value per-edge?

• enabled boolean, whether the quantity is initially enabled (note that generally only one quantity can be shown at a time; the most recent will be used)
• datatype, one of standard, symmetric, or magnitude, affects default colormap and map range
• vminmax, a 2-tuple of floats, specifying the min and max range to colormap in to
• cmap, which colormap to use