MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / midpoints

Function midpoints

galleries/examples/mplot3d/voxels_torus.py:15–20  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

13
14
15def midpoints(x):
16 sl = ()
17 for i in range(x.ndim):
18 x = (x[sl + np.index_exp[:-1]] + x[sl + np.index_exp[1:]]) / 2.0
19 sl += np.index_exp[:]
20 return x
21
22# prepare some coordinates, and attach rgb values to each
23r, theta, z = np.mgrid[0:1:11j, 0:np.pi*2:25j, -0.5:0.5:11j]

Callers 1

voxels_torus.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…