Skip to content

Commit b81566d

Browse files
committed
changed offset naming for annotations
svn path=/trunk/matplotlib/; revision=4638
1 parent c56d440 commit b81566d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/annotation_demo.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'axes points' : points from lower left corner of axes
1111
'axes pixels' : pixels from lower left corner of axes
1212
'axes fraction' : 0,1 is lower left of axes and 1,1 is upper right
13+
'offset points' : Specify an offset (in points) from the xy value
1314
'data' : use the axes data coordinate system
1415
1516
Optionally, you can specify arrow properties which draws and arrow

lib/matplotlib/text.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _get_layout(self, renderer):
187187

188188
xmin, ymin = thisx, thisy
189189
lines = self._text.split('\n')
190-
190+
191191
whs = []
192192
# Find full vertical extent of font,
193193
# including ascenders and descenders:
@@ -1025,7 +1025,7 @@ def __init__(self, s, xy,
10251025
'axes pixels' : pixels from lower left corner of axes
10261026
'axes fraction' : 0,1 is lower left of axes and 1,1 is upper right
10271027
'data' : use the coordinate system of the object being annotated (default)
1028-
'data offset' : Specify an offset (in points) from the xy value
1028+
'offset points' : Specify an offset (in points) from the xy value
10291029
'polar' : you can specify theta, r for the annotation, even
10301030
in cartesian plots. Note that if you
10311031
are using a polar axes, you do not need
@@ -1081,12 +1081,12 @@ def _get_xy(self, x, y, s):
10811081
x = float(self.convert_xunits(x))
10821082
y = float(self.convert_yunits(y))
10831083
return trans.xy_tup((x,y))
1084-
elif s=='data offset':
1084+
elif s=='offset points':
10851085
# convert the data point
10861086
dx, dy = self.xy
10871087

10881088
# prevent recursion
1089-
if self.xycoords == 'data offset':
1089+
if self.xycoords == 'offset points':
10901090
return self._get_xy(dx, dy, 'data')
10911091

10921092
dx, dy = self._get_xy(dx, dy, self.xycoords)

0 commit comments

Comments
 (0)