matplotlib 3.5.1

ParametersReturns
find_nearest_contour(self, x, y, indices=None, pixel=True)

Parameters

x, y : float

The reference point.

indices : list of int or None, default: None

Indices of contour levels to consider. If None (the default), all levels are considered.

pixel : bool, default: True

If True, measure distance in pixel (screen) space, which is useful for manual contour labeling; else, measure distance in axes space.

Returns

contour : `.Collection`

The contour that is closest to (x, y) .

segment : int

The index of the .Path in contour that is closest to (x, y) .

index : int

The index of the path segment in segment that is closest to (x, y) .

xmin, ymin : float

The point in the contour plot that is closest to (x, y) .

d2 : float

The squared distance from (xmin, ymin) to (x, y) .

Find the point in the contour plot that is closest to (x, y) .

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/contour.py#1336
type: <class 'function'>
Commit: