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

Function meshgrid_triangles

lib/matplotlib/tests/test_triangulation.py:1092–1104  ·  view source on GitHub ↗

Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.

(n)

Source from the content-addressed store, hash-verified

1090
1091
1092def meshgrid_triangles(n):
1093 """
1094 Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.
1095 """
1096 tri = []
1097 for i in range(n-1):
1098 for j in range(n-1):
1099 a = i + j*n
1100 b = (i+1) + j*n
1101 c = i + (j+1)*n
1102 d = (i+1) + (j+1)*n
1103 tri += [[a, b, d], [a, d, c]]
1104 return np.array(tri, dtype=np.int32)
1105
1106
1107def test_triplot_return():

Callers 3

test_triinterpFunction · 0.85
test_tritoolsFunction · 0.85
test_trirefineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…