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

Function midpoints

galleries/examples/mplot3d/voxels_rgb.py:13–18  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

11
12
13def midpoints(x):
14 sl = ()
15 for _ in range(x.ndim):
16 x = (x[sl + np.index_exp[:-1]] + x[sl + np.index_exp[1:]]) / 2.0
17 sl += np.index_exp[:]
18 return x
19
20# prepare some coordinates, and attach rgb values to each
21r, g, b = np.indices((17, 17, 17)) / 16.0

Callers 2

voxels_rgb.pyFile · 0.70
test_xyzMethod · 0.50

Calls

no outgoing calls

Tested by 1

test_xyzMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…