Skip to content

Commit de85cf6

Browse files
committed
MNT: Remove deprecated get_label_coords from contourLabeler
1 parent 0e541df commit de85cf6

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

doc/api/next_api_changes/removals/23XXX-GL.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ Get/set window title methods have been removed from the canvas
33

44
Use the corresponding methods on the FigureManager if using pyplot,
55
or GUI-specific methods if embedding.
6+
7+
``ContourLabeler.get_label_coords()`` has been removed
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
There is no replacement, it was considered an internal helper.
11+

lib/matplotlib/contour.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -248,31 +248,6 @@ def too_close(self, x, y, lw):
248248
return any((x - loc[0]) ** 2 + (y - loc[1]) ** 2 < thresh
249249
for loc in self.labelXYs)
250250

251-
@_api.deprecated("3.4")
252-
def get_label_coords(self, distances, XX, YY, ysize, lw):
253-
"""
254-
Return x, y, and the index of a label location.
255-
256-
Labels are plotted at a location with the smallest
257-
deviation of the contour from a straight line
258-
unless there is another label nearby, in which case
259-
the next best place on the contour is picked up.
260-
If all such candidates are rejected, the beginning
261-
of the contour is chosen.
262-
"""
263-
hysize = int(ysize / 2)
264-
adist = np.argsort(distances)
265-
266-
for ind in adist:
267-
x, y = XX[ind][hysize], YY[ind][hysize]
268-
if self.too_close(x, y, lw):
269-
continue
270-
return x, y, ind
271-
272-
ind = adist[0]
273-
x, y = XX[ind][hysize], YY[ind][hysize]
274-
return x, y, ind
275-
276251
def _get_nth_label_width(self, nth):
277252
"""Return the width of the *nth* label, in pixels."""
278253
fig = self.axes.figure

0 commit comments

Comments
 (0)