Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a65151b

Browse filesBrowse files
committed
removed un-needed legacy code (_AnnotationBase._get_xy_legacy)
All of the work done in _get_xy_legacy can be done via transforms returned by _get_xy_transform. Removed the sole usage of this function and the function.
1 parent d583f3b commit a65151b
Copy full SHA for a65151b

File tree

1 file changed

+0
-34
lines changed
Filter options

1 file changed

+0
-34
lines changed

‎lib/matplotlib/text.py

Copy file name to clipboardExpand all lines: lib/matplotlib/text.py
-34Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,9 +1463,6 @@ def _get_xy(self, renderer, x, y, s):
14631463
if s2 == 'data':
14641464
y = float(self.convert_yunits(y))
14651465

1466-
if s in ['axes points', 'axes pixel', 'figure points', 'figure pixel']:
1467-
return self._get_xy_legacy(renderer, x, y, s)
1468-
14691466
tr = self._get_xy_transform(renderer, s)
14701467
x1, y1 = tr.transform_point((x, y))
14711468
return x1, y1
@@ -1588,37 +1585,6 @@ def _get_ref_xy(self, renderer):
15881585
# raise ValueError("A bbox instance is expected but got %s" %
15891586
# str(bbox))
15901587

1591-
def _get_xy_legacy(self, renderer, x, y, s):
1592-
"""
1593-
only used when s in ['axes points', 'axes pixel', 'figure points',
1594-
'figure pixel'].
1595-
"""
1596-
s_ = s.split()
1597-
bbox0, xy0 = None, None
1598-
bbox_name, unit = s_
1599-
1600-
if bbox_name == "figure":
1601-
bbox0 = self.figure.bbox
1602-
elif bbox_name == "axes":
1603-
bbox0 = self.axes.bbox
1604-
1605-
if unit == "points":
1606-
sc = self.figure.get_dpi() / 72.
1607-
elif unit == "pixels":
1608-
sc = 1
1609-
1610-
l, b, r, t = bbox0.extents
1611-
if x < 0:
1612-
x = r + x * sc
1613-
else:
1614-
x = l + x * sc
1615-
if y < 0:
1616-
y = t + y * sc
1617-
else:
1618-
y = b + y * sc
1619-
1620-
return x, y
1621-
16221588
def set_annotation_clip(self, b):
16231589
"""
16241590
set *annotation_clip* attribute.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.