From: <ef...@us...> - 2009-02-28 18:51:46
|
Revision: 6944 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6944&view=rev Author: efiring Date: 2009-02-28 18:51:37 +0000 (Sat, 28 Feb 2009) Log Message: ----------- Prevent double-rendering of shared axis in twinx, twiny Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2009-02-28 07:46:14 UTC (rev 6943) +++ trunk/matplotlib/CHANGELOG 2009-02-28 18:51:37 UTC (rev 6944) @@ -1,3 +1,5 @@ +2009-02-28 Prevent double-rendering of shared axis in twinx, twiny - EF + 2009-02-26 Add optional bbox_to_anchor argument for legend class - JJL 2009-02-26 Support image clipping in pdf backend. - JKS Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 07:46:14 UTC (rev 6943) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 18:51:37 UTC (rev 6944) @@ -532,6 +532,11 @@ self._frameon = frameon self._axisbelow = rcParams['axes.axisbelow'] + # Attributes for controlling whether axis objects are drawn. + # They are helpers for twinx and twiny. + self._xaxison = True + self._yaxison = True + self._hold = rcParams['axes.hold'] self._connected = {} # a dict from events to (id, func) self.cla() @@ -1647,7 +1652,10 @@ else: self.xaxis.set_zorder(2.5) self.yaxis.set_zorder(2.5) - artists.extend([self.xaxis, self.yaxis]) + if self._xaxison: + artists.append(self.xaxis) + if self._yaxison: + artists.append(self.yaxis) if not inframe: artists.append(self.title) artists.extend(self.tables) if self.legend_ is not None: @@ -6602,6 +6610,7 @@ ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') self.yaxis.tick_left() + ax2._xaxison = False return ax2 def twiny(self): @@ -6621,6 +6630,7 @@ ax2.xaxis.tick_top() ax2.xaxis.set_label_position('top') self.xaxis.tick_bottom() + ax2._yaxison = False return ax2 def get_shared_x_axes(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |