From: <md...@us...> - 2008-06-06 16:57:21
|
Revision: 5412 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5412&view=rev Author: mdboom Date: 2008-06-06 09:57:06 -0700 (Fri, 06 Jun 2008) Log Message: ----------- Fix callbacks accumulating bug by using a ScaledTranslation rather than a callback on dpi change. Fix ScaledTranslation.__repr__ (Thanks Stan West for tracking down and fixing these issues). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/transforms.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-06 16:34:00 UTC (rev 5411) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-06 16:57:06 UTC (rev 5412) @@ -827,8 +827,8 @@ props = font_manager.FontProperties(size=rcParams['axes.titlesize']) - self.titleOffsetTrans = mtransforms.Affine2D().translate( - 0.0, 5.0*self.figure.dpi/72.) + self.titleOffsetTrans = mtransforms.ScaledTranslation( + 0.0, 5.0 / 72.0, self.figure.dpi_scale_trans) self.title = mtext.Text( x=0.5, y=1.0, text='', fontproperties=props, @@ -859,17 +859,7 @@ self.xaxis.set_clip_path(self.axesPatch) self.yaxis.set_clip_path(self.axesPatch) - self.titleOffsetTrans.clear().translate( - 0.0, 5.0*self.figure.dpi/72.) - def on_dpi_change(fig): - self.titleOffsetTrans.clear().translate( - 0.0, 5.0*fig.dpi/72.) - - self.figure.callbacks.connect('dpi_changed', on_dpi_change) - - - def clear(self): 'clear the axes' self.cla() Modified: trunk/matplotlib/lib/matplotlib/transforms.py =================================================================== --- trunk/matplotlib/lib/matplotlib/transforms.py 2008-06-06 16:34:00 UTC (rev 5411) +++ trunk/matplotlib/lib/matplotlib/transforms.py 2008-06-06 16:57:06 UTC (rev 5412) @@ -2043,7 +2043,7 @@ self._inverted = None def __repr__(self): - return "ScaledTranslation(%s)" % (self._t) + return "ScaledTranslation(%s)" % (self._t,) __str__ = __repr__ def get_matrix(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |