MCPcopy
hub / github.com/tum-pbs/PhiFlow / plotCubeAt

Function plotCubeAt

phi/vis/_matplotlib/_matplotlib_plots.py:432–440  ·  view source on GitHub ↗
(positions, sizes=None, colors=None, **kwargs)

Source from the content-addressed store, hash-verified

430
431
432def plotCubeAt(positions, sizes=None, colors=None, **kwargs):
433 if not isinstance(colors, (list, np.ndarray)):
434 colors = ["C0"] * len(positions)
435 if not isinstance(sizes, (list, np.ndarray)):
436 sizes = [(1, 1, 1)] * len(positions)
437 g = []
438 for p, s, c in zip(positions, sizes, colors):
439 g.append(cuboid_data(p, size=s))
440 return Poly3DCollection(np.concatenate(g), facecolors=np.repeat(colors, 6, axis=0), **kwargs)
441
442
443class VectorCloud2D(Recipe):

Callers 1

plotMethod · 0.85

Calls 2

cuboid_dataFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected