Skip to content

Commit a810649

Browse files
committed
Rework tricontour and tricontourf documentation
As part of matplotlib#10148: Docstring update for `Axes.tricontour()` and `Axes.tricontourf()`.
1 parent 028f07c commit a810649

1 file changed

Lines changed: 16 additions & 53 deletions

File tree

‎lib/matplotlib/tri/tricontour.py‎

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -84,68 +84,31 @@ def _contour_args(self, args, kwargs):
8484
_docstring.interpd.update(_tricontour_doc="""
8585
Draw contour %(type)s on an unstructured triangular grid.
8686
87-
The triangulation can be specified in one of two ways; either ::
87+
Call signatures::
8888
89-
%(func)s(triangulation, ...)
89+
%(func)s(triangulation, Z, [levels], ...)
90+
%(func)s(x, y, Z, [levels], *, [triangles=triangles], [mask=mask], ...)
9091
91-
where *triangulation* is a `.Triangulation` object, or ::
92+
The triangular grid can be specified either by passing a `.Triangulation`
93+
object as the first parameter, or by passing the points *x*, *y* and
94+
optionally the *triangles* and a *mask*. See `.Triangulation` for an
95+
explanation of these parameters. If neither of *triangulation* or
96+
*triangles* are given, the triangulation is calculated on the fly.
9297
93-
%(func)s(x, y, ...)
94-
%(func)s(x, y, triangles, ...)
95-
%(func)s(x, y, triangles=triangles, ...)
96-
%(func)s(x, y, mask=mask, ...)
97-
%(func)s(x, y, triangles, mask=mask, ...)
98-
99-
in which case a `.Triangulation` object will be created. See that class'
100-
docstring for an explanation of these cases.
101-
102-
The remaining arguments may be::
103-
104-
%(func)s(..., Z)
105-
106-
where *Z* is the array of values to contour, one per point in the
107-
triangulation. The level values are chosen automatically.
108-
109-
::
110-
111-
%(func)s(..., Z, levels)
112-
113-
contour up to *levels+1* automatically chosen contour levels (*levels*
114-
intervals).
115-
116-
::
117-
118-
%(func)s(..., Z, levels)
119-
120-
draw contour %(type)s at the values specified in sequence *levels*, which must
121-
be in increasing order.
122-
123-
::
124-
125-
%(func)s(Z, **kwargs)
126-
127-
Use keyword arguments to control colors, linewidth, origin, cmap ... see below
128-
for more details.
98+
It is possible to pass *triangles* positionally, i.e.
99+
`%(func)s(x, y, triangles, Z, ...)`. However, this is discouraged. For more
100+
clarity, pass *triangles* via keyword argument.
129101
130102
Parameters
131103
----------
132104
triangulation : `.Triangulation`, optional
133-
The unstructured triangular grid.
134-
135-
If specified, then *x*, *y*, *triangles*, and *mask* are not accepted.
136-
137-
x, y : array-like, optional
138-
The coordinates of the values in *Z*.
139-
140-
triangles : (ntri, 3) array-like of int, optional
141-
For each triangle, the indices of the three points that make up the
142-
triangle, ordered in an anticlockwise manner. If not specified, the
143-
Delaunay triangulation is calculated.
105+
An already created triangular grid.
144106
145-
mask : (ntri,) array-like of bool, optional
146-
Which triangles are masked out.
107+
x, y, triangles, mask
108+
Parameters defining the triangular grid. See `.Triangulation`.
109+
This is mutually exclusive with specifying *triangulation*.
147110
148-
Z : 2D array-like
111+
Z : array-like
149112
The height values over which the contour is drawn.
150113
151114
levels : int or array-like, optional

0 commit comments

Comments
 (0)