@@ -1297,24 +1297,34 @@ def set_alpha(self, alpha):
1297
1297
1298
1298
def find_nearest_contour (self , x , y , indices = None , pixel = True ):
1299
1299
"""
1300
- Finds contour that is closest to a point. Defaults to
1301
- measuring distance in pixels (screen space - useful for manual
1302
- contour labeling), but this can be controlled via a keyword
1303
- argument.
1300
+ Find the point in the contour plot that is closest to ``(x, y)``.
1304
1301
1305
- Returns a tuple containing the contour, segment, index of
1306
- segment, x & y of segment point and distance to minimum point.
1307
-
1308
- Optional keyword arguments:
1309
-
1310
- *indices*:
1311
- Indexes of contour levels to consider when looking for
1312
- nearest point. Defaults to using all levels.
1313
-
1314
- *pixel*:
1315
- If *True*, measure distance in pixel space, if not, measure
1316
- distance in axes space. Defaults to *True*.
1302
+ Parameters
1303
+ ----------
1304
+ x, y: float
1305
+ The reference point.
1306
+ indices : list of int or None, default: None
1307
+ Indices of contour levels to consider. If None (the default), all
1308
+ levels are considered.
1309
+ pixel : bool, default: True
1310
+ If *True*, measure distance in pixel (screen) space, which is
1311
+ useful for manual contour labeling; else, measure distance in axes
1312
+ space.
1317
1313
1314
+ Returns
1315
+ -------
1316
+ contour : `.Collection`
1317
+ The contour that is closest to ``(x, y)``.
1318
+ segment : int
1319
+ The index of the `.Path` in *contour* that is closest to
1320
+ ``(x, y)``.
1321
+ index : int
1322
+ The index of the path segment in *segment* that is closest to
1323
+ ``(x, y)``.
1324
+ xmin, ymin : float
1325
+ The point in the contour plot that is closest to ``(x, y)``.
1326
+ d : float
1327
+ The distance from ``(xmin, ymin)`` to ``(x, y)``.
1318
1328
"""
1319
1329
1320
1330
# This function uses a method that is probably quite
0 commit comments