Skip to content

Commit 43ed248

Browse files
committed
Some doc cleanup of Triangulation
1 parent 90e30e4 commit 43ed248

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

lib/matplotlib/tri/triangulation.py

+20-13
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ class Triangulation(object):
1212
1313
Parameters
1414
----------
15-
x, y : array_like of shape (npoints)
15+
x, y : array-like of shape (npoints)
1616
Coordinates of grid points.
1717
triangles : integer array_like of shape (ntri, 3), optional
1818
For each triangle, the indices of the three points that make
1919
up the triangle, ordered in an anticlockwise manner. If not
2020
specified, the Delaunay triangulation is calculated.
21-
mask : boolean array_like of shape (ntri), optional
21+
mask : boolean array-like of shape (ntri), optional
2222
Which triangles are masked out.
2323
2424
Attributes
2525
----------
26-
`edges`
27-
`neighbors`
26+
edges : int array of shape (nedges, 2)
27+
See `~.Triangulation.edges`
28+
neighbors : int array of shape (ntri, 3)
29+
See `~.Triangulation.neighbors`
30+
mask : bool array of shape (ntri, 3)
31+
Masked out triangles.
2832
is_delaunay : bool
2933
Whether the Triangulation is a calculated Delaunay
3034
triangulation (where `triangles` was not specified) or not.
@@ -76,29 +80,32 @@ def __init__(self, x, y, triangles=None, mask=None):
7680
def calculate_plane_coefficients(self, z):
7781
"""
7882
Calculate plane equation coefficients for all unmasked triangles from
79-
the point (x,y) coordinates and specified z-array of shape (npoints).
80-
Returned array has shape (npoints,3) and allows z-value at (x,y)
83+
the point (x, y) coordinates and specified z-array of shape (npoints).
84+
The returned array has shape (npoints, 3) and allows z-value at (x, y)
8185
position in triangle tri to be calculated using
82-
z = array[tri,0]*x + array[tri,1]*y + array[tri,2].
86+
``z = array[tri, 0] *x + array[tri, 1] * y + array[tri, 2]``.
8387
"""
8488
return self.get_cpp_triangulation().calculate_plane_coefficients(z)
8589

8690
@property
8791
def edges(self):
8892
"""
89-
Return integer array of shape (nedges,2) containing all edges of
93+
Return integer array of shape (nedges, 2) containing all edges of
9094
non-masked triangles.
9195
92-
Each edge is the start point index and end point index. Each
93-
edge (start,end and end,start) appears only once.
96+
Each row defines an edge by it's start point index and end point
97+
index. Each edge appears only once, i.e. for an edge between points
98+
*i* and *j*, there will only be either *(i, j)* or *(j, i)*.
9499
"""
95100
if self._edges is None:
96101
self._edges = self.get_cpp_triangulation().get_edges()
97102
return self._edges
98103

99104
def get_cpp_triangulation(self):
100-
# Return the underlying C++ Triangulation object, creating it
101-
# if necessary.
105+
"""
106+
Return the underlying C++ Triangulation object, creating it
107+
if necessary.
108+
"""
102109
if self._cpp_triangulation is None:
103110
self._cpp_triangulation = _tri.Triangulation(
104111
self.x, self.y, self.triangles, self.mask, self._edges,
@@ -175,7 +182,7 @@ def get_trifinder(self):
175182
@property
176183
def neighbors(self):
177184
"""
178-
Return integer array of shape (ntri,3) containing neighbor
185+
Return integer array of shape (ntri, 3) containing neighbor
179186
triangles.
180187
181188
For each triangle, the indices of the three triangles that

0 commit comments

Comments
 (0)