matplotlib 3.5.1

NotesParametersReturns
get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True)

Returns a mask new_mask which allows to clean the encapsulated triangulation from its border-located flat triangles (according to their circle_ratios ). This mask is meant to be subsequently applied to the triangulation using .Triangulation.set_mask . new_mask is an extension of the initial triangulation mask in the sense that an initially masked triangle will remain masked.

The new_mask array is computed recursively; at each step flat triangles are removed only if they share a side with the current mesh border. Thus no new holes in the triangulated domain will be created.

Notes

The rationale behind this function is that a Delaunay triangulation - of an unstructured set of points - sometimes contains almost flat triangles at its border, leading to artifacts in plots (especially for high-resolution contouring). Masked with computed new_mask, the encapsulated triangulation would contain no more unmasked border triangles with a circle ratio below min_circle_ratio, thus improving the mesh quality for subsequent plots or interpolation.

Parameters

min_circle_ratio : float, default: 0.01

Border triangles with incircle/circumcircle radii ratio r/R will be removed if r/R < min_circle_ratio.

rescale : bool, default: True

If True, first, internally rescale (based on :None:None:`scale_factors`) so that the (unmasked) triangles fit exactly inside a unit square mesh. This rescaling accounts for the difference of scale which might exist between the 2 axis.

Returns

array of bool

Mask to apply to encapsulated triangulation. All the initially masked triangles remain masked in the new_mask.

Eliminate excessively flat border triangles from the triangulation.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/tri/tritools.py#117
type: <class 'function'>
Commit: