From: <ef...@us...> - 2011-02-06 02:41:28
|
Revision: 8950 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8950&view=rev Author: efiring Date: 2011-02-06 02:41:22 +0000 (Sun, 06 Feb 2011) Log Message: ----------- collections with color mapping: don't update rgba unnecesarily Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2011-02-06 01:55:50 UTC (rev 8949) +++ trunk/matplotlib/lib/matplotlib/collections.py 2011-02-06 02:41:22 UTC (rev 8950) @@ -479,9 +479,12 @@ If the scalar mappable array is not none, update colors from scalar data """ - if self._A is None: return + if self._A is None: + return if self._A.ndim > 1: raise ValueError('Collections can only map rank 1 arrays') + if not self.check_update("array"): + return if self._is_filled: self._facecolors = self.to_rgba(self._A, self._alpha) elif self._is_stroked: @@ -807,7 +810,7 @@ The default is 5 pt. The use of :class:`~matplotlib.cm.ScalarMappable` is optional. - If the :class:`~matplotlib.cm.ScalarMappable` matrix + If the :class:`~matplotlib.cm.ScalarMappable` array :attr:`~matplotlib.cm.ScalarMappable._A` is not None (ie a call to :meth:`~matplotlib.cm.ScalarMappable.set_array` has been made), at draw time a call to scalar mappable will be made to set the colors. @@ -1215,8 +1218,7 @@ offsets = np.asarray(offsets, np.float_) - if self.check_update('array'): - self.update_scalarmappable() + self.update_scalarmappable() if not transform.is_affine: coordinates = self._coordinates.reshape( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |