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

Function tripcolor

lib/matplotlib/tri/_tripcolor.py:9–169  ·  view source on GitHub ↗

Create a pseudocolor plot of an unstructured triangular grid. Call signatures:: tripcolor(triangulation, c, *, ...) tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...) The triangular grid can be specified either by passing a `.Triangulation` object as the f

(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
              vmax=None, shading='flat', facecolors=None, **kwargs)

Source from the content-addressed store, hash-verified

7
8@_docstring.interpd
9def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
10 vmax=None, shading='flat', facecolors=None, **kwargs):
11 """
12 Create a pseudocolor plot of an unstructured triangular grid.
13
14 Call signatures::
15
16 tripcolor(triangulation, c, *, ...)
17 tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...)
18
19 The triangular grid can be specified either by passing a `.Triangulation`
20 object as the first parameter, or by passing the points *x*, *y* and
21 optionally the *triangles* and a *mask*. See `.Triangulation` for an
22 explanation of these parameters.
23
24 It is possible to pass the triangles positionally, i.e.
25 ``tripcolor(x, y, triangles, c, ...)``. However, this is discouraged.
26 For more clarity, pass *triangles* via keyword argument.
27
28 If neither of *triangulation* or *triangles* are given, the triangulation
29 is calculated on the fly. In this case, it does not make sense to provide
30 colors at the triangle faces via *c* or *facecolors* because there are
31 multiple possible triangulations for a group of points and you don't know
32 which triangles will be constructed.
33
34 Parameters
35 ----------
36 triangulation : `.Triangulation`
37 An already created triangular grid.
38 x, y, triangles, mask
39 Parameters defining the triangular grid. See `.Triangulation`.
40 This is mutually exclusive with specifying *triangulation*.
41 c : array-like
42 The color values, either for the points or for the triangles. Which one
43 is automatically inferred from the length of *c*, i.e. does it match
44 the number of points or the number of triangles. If there are the same
45 number of points and triangles in the triangulation it is assumed that
46 color values are defined at points; to force the use of color values at
47 triangles use the keyword argument ``facecolors=c`` instead of just
48 ``c``.
49 This parameter is position-only.
50 facecolors : array-like, optional
51 Can be used alternatively to *c* to specify colors at the triangle
52 faces. This parameter takes precedence over *c*.
53 shading : {'flat', 'gouraud'}, default: 'flat'
54 If 'flat' and the color values *c* are defined at points, the color
55 values used for each triangle are from the mean c of the triangle's
56 three points. If *shading* is 'gouraud' then color values must be
57 defined at points.
58 %(cmap_doc)s
59
60 %(norm_doc)s
61
62 %(vmin_vmax_doc)s
63
64 %(colorizer_doc)s
65
66 Returns

Callers

nothing calls this directly

Calls 12

TriMeshClass · 0.90
PolyCollectionClass · 0.90
get_masked_trianglesMethod · 0.80
minMethod · 0.80
maxMethod · 0.80
add_collectionMethod · 0.80
popMethod · 0.45
_scale_normMethod · 0.45
gridMethod · 0.45
update_datalimMethod · 0.45
autoscale_viewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…