From: <md...@us...> - 2008-06-25 12:50:19
|
Revision: 5671 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5671&view=rev Author: mdboom Date: 2008-06-25 05:49:57 -0700 (Wed, 25 Jun 2008) Log Message: ----------- Fix rendering quality of pcolor. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-06-24 19:15:20 UTC (rev 5670) +++ trunk/matplotlib/CHANGELOG 2008-06-25 12:49:57 UTC (rev 5671) @@ -1,9 +1,11 @@ +2008-06-25 Fix rendering quality of pcolor - MGD + ================================================================= -2006-02-24 Released 0.98.2 at svn r5667 - (source only for debian) JDH +2008-06-24 Released 0.98.2 at svn r5667 - (source only for debian) JDH -2006-06-24 Added "transparent" kwarg to savefig. - MGD +2008-06-24 Added "transparent" kwarg to savefig. - MGD -2006-06-24 Applied Stefan's patch to draw a sinle centered marker over +2008-06-24 Applied Stefan's patch to draw a sinle centered marker over a line with numpoints==1 - JDH 2008-06-23 Use splines to render circles in scatter plots - MGD Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-24 19:15:20 UTC (rev 5670) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-25 12:49:57 UTC (rev 5671) @@ -5563,8 +5563,8 @@ edgecolors = (0,0,0,1), linewidths = (0.25,) else: - edgecolors = 'None' - linewidths = (0.0,) + edgecolors = 'face' + linewidths = (1.0,) kwargs.setdefault('edgecolors', edgecolors) kwargs.setdefault('antialiaseds', (0,)) kwargs.setdefault('linewidths', linewidths) @@ -5607,8 +5607,8 @@ *C* may be a masked array, but *X* and *Y* may not. Masked array support is implemented via *cmap* and *norm*; in - contrast, *pcolor* simply does not draw quadrilaterals with - masked colors or vertices. + contrast, :func:`~matplotlib.pyplot.pcolor` simply does not + draw quadrilaterals with masked colors or vertices. Keyword arguments: @@ -5646,7 +5646,7 @@ *alpha*: 0 <= scalar <= 1 the alpha blending value - Return value is a :class:`matplotlib.collection.Collection` + Return value is a :class:`matplotlib.collection.QuadMesh` object. See :func:`~matplotlib.pyplot.pcolor` for an explanation of Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008-06-24 19:15:20 UTC (rev 5670) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-06-25 12:49:57 UTC (rev 5671) @@ -184,11 +184,16 @@ offsets = transOffset.transform_non_affine(offsets) transOffset = transOffset.get_affine() + if self._edgecolors == 'face': + edgecolors = self._facecolors + else: + edgecolors = self._edgecolors + renderer.draw_path_collection( transform.frozen(), self.clipbox, clippath, clippath_trans, paths, self.get_transforms(), offsets, transOffset, - self._facecolors, self._edgecolors, self._linewidths, + self._facecolors, edgecolors, self._linewidths, self._linestyles, self._antialiaseds) renderer.close_group(self.__class__.__name__) @@ -318,12 +323,18 @@ Set the edgecolor(s) of the collection. *c* can be a matplotlib color arg (all patches have same color), or a sequence or rgba tuples; if it is a sequence the patches will - cycle through the sequence + cycle through the sequence. + If *c* is 'face', the edge color will always be the same as + the face color. + ACCEPTS: matplotlib color arg or sequence of rgba tuples """ - if c is None: c = mpl.rcParams['patch.edgecolor'] - self._edgecolors = _colors.colorConverter.to_rgba_array(c, self._alpha) + if c == 'face': + self._edgecolors = 'face' + else: + if c is None: c = mpl.rcParams['patch.edgecolor'] + self._edgecolors = _colors.colorConverter.to_rgba_array(c, self._alpha) set_edgecolors = set_edgecolor This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |