Revision: 4955
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4955&view=rev
Author: efiring
Date: 2008-02-12 18:09:06 -0800 (Tue, 12 Feb 2008)
Log Message:
-----------
Improve colorbar handling of "hold" state
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/colorbar.py
Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-13 01:30:03 UTC (rev
4954)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2008-02-13 02:09:06 UTC (rev
4955)
@@ -272,15 +272,20 @@
'''
Draw the colors using pcolor; optionally add separators.
'''
- ## Change to pcolormesh if/when it is fixed to handle alpha
- ## correctly.
+ ## Change to pcolorfast after fixing bugs in some backends...
if self.orientation == 'vertical':
args = (X, Y, C)
else:
args = (npy.transpose(Y), npy.transpose(X), npy.transpose(C))
kw = {'cmap':self.cmap, 'norm':self.norm,
'shading':'flat', 'alpha':self.alpha}
+ # Save, set, and restore hold state to keep pcolor from
+ # clearing the axes. Ordinarily this will not be needed,
+ # since the axes object should already have hold set.
+ _hold = self.ax.ishold()
+ self.ax.hold(True)
col = self.ax.pcolor(*args, **kw)
+ self.ax.hold(_hold)
#self.add_observer(col) # We should observe, not be observed...
self.solids = col
if self.drawedges:
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins