SF.net SVN: matplotlib:[6944] trunk/matplotlib

2009-02-28 Thread efiring
Revision: 6944
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6944&view=rev
Author:   efiring
Date: 2009-02-28 18:51:37 + (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.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib:[6945] trunk/matplotlib/lib/matplotlib/axes.py

2009-02-28 Thread efiring
Revision: 6945
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6945&view=rev
Author:   efiring
Date: 2009-02-28 20:13:38 + (Sat, 28 Feb 2009)

Log Message:
---
Better solution for twinx, twiny, thanks to Jae-Joon Lee

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes.py

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 18:51:37 UTC (rev 
6944)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 20:13:38 UTC (rev 
6945)
@@ -532,11 +532,6 @@
 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()
@@ -1652,10 +1647,7 @@
 else:
 self.xaxis.set_zorder(2.5)
 self.yaxis.set_zorder(2.5)
-if self._xaxison:
-artists.append(self.xaxis)
-if self._yaxison:
-artists.append(self.yaxis)
+artists.extend([self.xaxis, self.yaxis])
 if not inframe: artists.append(self.title)
 artists.extend(self.tables)
 if self.legend_ is not None:
@@ -6610,7 +6602,7 @@
 ax2.yaxis.tick_right()
 ax2.yaxis.set_label_position('right')
 self.yaxis.tick_left()
-ax2._xaxison = False
+ax2.xaxis.set_visible(False)
 return ax2
 
 def twiny(self):
@@ -6630,7 +6622,7 @@
 ax2.xaxis.tick_top()
 ax2.xaxis.set_label_position('top')
 self.xaxis.tick_bottom()
-ax2._yaxison = False
+ax2.yaxis.set_visible(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.

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins