From: <jd...@us...> - 2007-10-15 21:22:07
|
Revision: 3952 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3952&view=rev Author: jdh2358 Date: 2007-10-15 14:22:03 -0700 (Mon, 15 Oct 2007) Log Message: ----------- fixed a unit problem with annotations Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2007-10-15 21:08:35 UTC (rev 3951) +++ trunk/matplotlib/lib/matplotlib/text.py 2007-10-15 21:22:03 UTC (rev 3952) @@ -1077,6 +1077,8 @@ def _get_xy(self, x, y, s): if s=='data': trans = self.axes.transData + x = float(self.convert_xunits(x)) + y = float(self.convert_yunits(y)) return trans.xy_tup((x,y)) elif s=='polar': theta, r = x, y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jr...@us...> - 2007-12-06 00:04:51
|
Revision: 4636 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4636&view=rev Author: jrevans Date: 2007-12-05 16:04:49 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Added a 'data offset' coordinate to the Annotation class. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2007-12-05 23:01:05 UTC (rev 4635) +++ trunk/matplotlib/lib/matplotlib/text.py 2007-12-06 00:04:49 UTC (rev 4636) @@ -1080,6 +1080,24 @@ x = float(self.convert_xunits(x)) y = float(self.convert_yunits(y)) return trans.xy_tup((x,y)) + elif s=='data offset': + # convert the data point + dx, dy = self.xy + trans = self.axes.transData + dx = float(self.convert_xunits(dx)) + dy = float(self.convert_yunits(dy)) + dx, dy = trans.xy_tup((dx, dy)) + + # convert the offset + dpi = self.figure.dpi.get() + x *= dpi/72. + y *= dpi/72. + + # add the offset to the data point + x += dx + y += dy + + return x, y elif s=='polar': theta, r = x, y x = r*npy.cos(theta) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jr...@us...> - 2007-12-06 00:09:50
|
Revision: 4637 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4637&view=rev Author: jrevans Date: 2007-12-05 16:09:49 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Submitted the wrong version. This is the correct one. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2007-12-06 00:04:49 UTC (rev 4636) +++ trunk/matplotlib/lib/matplotlib/text.py 2007-12-06 00:09:49 UTC (rev 4637) @@ -1025,6 +1025,7 @@ 'axes pixels' : pixels from lower left corner of axes 'axes fraction' : 0,1 is lower left of axes and 1,1 is upper right 'data' : use the coordinate system of the object being annotated (default) + 'data offset' : Specify an offset (in points) from the xy value 'polar' : you can specify theta, r for the annotation, even in cartesian plots. Note that if you are using a polar axes, you do not need @@ -1083,11 +1084,13 @@ elif s=='data offset': # convert the data point dx, dy = self.xy - trans = self.axes.transData - dx = float(self.convert_xunits(dx)) - dy = float(self.convert_yunits(dy)) - dx, dy = trans.xy_tup((dx, dy)) + # prevent recursion + if self.xycoords == 'data offset': + return self._get_xy(dx, dy, 'data') + + dx, dy = self._get_xy(dx, dy, self.xycoords) + # convert the offset dpi = self.figure.dpi.get() x *= dpi/72. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-12 14:52:52
|
Revision: 4707 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4707&view=rev Author: mdboom Date: 2007-12-12 06:52:01 -0800 (Wed, 12 Dec 2007) Log Message: ----------- Support fontconfig syntax in Text constructor. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2007-12-12 14:08:15 UTC (rev 4706) +++ trunk/matplotlib/lib/matplotlib/text.py 2007-12-12 14:52:01 UTC (rev 4707) @@ -675,6 +675,8 @@ ACCEPTS: a matplotlib.font_manager.FontProperties instance """ + if is_string_like(fp): + fp = FontProperties(fp) self._fontproperties = fp artist.kwdocd['Text'] = artist.kwdoc(Text) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-11 15:31:23
|
Revision: 5470 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5470&view=rev Author: jdh2358 Date: 2008-06-11 08:31:21 -0700 (Wed, 11 Jun 2008) Log Message: ----------- fixed a text layout bug where layout was cached between renderers Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2008-06-11 12:37:21 UTC (rev 5469) +++ trunk/matplotlib/lib/matplotlib/text.py 2008-06-11 15:31:21 UTC (rev 5470) @@ -394,7 +394,7 @@ return (x, y, self._text, self._color, self._verticalalignment, self._horizontalalignment, hash(self._fontproperties), self._rotation, - self._renderer.dpi + self._renderer.dpi, id(self._renderer) ) def get_text(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2008-06-28 13:50:51
|
Revision: 5697 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5697&view=rev Author: jdh2358 Date: 2008-06-28 06:50:45 -0700 (Sat, 28 Jun 2008) Log Message: ----------- reverting text with dash fixes; see post on mailing list Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/text.py Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2008-06-28 01:10:58 UTC (rev 5696) +++ trunk/matplotlib/lib/matplotlib/text.py 2008-06-28 13:50:45 UTC (rev 5697) @@ -745,8 +745,8 @@ def get_position(self): "Return x, y as tuple" - x = float(self.convert_xunits(self._x)) - y = float(self.convert_yunits(self._y)) + x = float(self.convert_xunits(self._dashx)) + y = float(self.convert_yunits(self._dashy)) return x, y def get_prop_tup(self): @@ -939,8 +939,7 @@ ACCEPTS: float """ - self._x = float(x) - self._dashx = self._x + self._dashx = float(x) def set_y(self, y): """ @@ -948,8 +947,7 @@ ACCEPTS: float """ - self._y = float(y) - self._dashy = self._y + self._dashy = float(y) def set_transform(self, t): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |