From: <md...@us...> - 2008-07-07 17:48:50
|
Revision: 5716 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5716&view=rev Author: mdboom Date: 2008-07-07 10:48:36 -0700 (Mon, 07 Jul 2008) Log Message: ----------- Fix custom scales in pcolormesh (thanks, Matthew Turk) Modified Paths: -------------- trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py =================================================================== --- trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-07-07 17:37:33 UTC (rev 5715) +++ trunk/matplotlib/examples/pylab_examples/quadmesh_demo.py 2008-07-07 17:48:36 UTC (rev 5716) @@ -29,6 +29,8 @@ ax = fig.add_subplot(121) ax.set_axis_bgcolor("#bdb76b") ax.pcolormesh(Qx,Qz,Z) +ax.set_xscale('log') +ax.set_yscale('log') ax.set_title('Without masked values') ax = fig.add_subplot(122) Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008-07-07 17:37:33 UTC (rev 5715) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-07-07 17:48:36 UTC (rev 5716) @@ -512,14 +512,24 @@ if clippath_trans is not None: clippath_trans = clippath_trans.frozen() - assert transform.is_affine + if not transform.is_affine: + coordinates = self._coordinates.reshape( + (self._coordinates.shape[0] * + self._coordinates.shape[1], + 2)) + coordinates = transform.transform(coordinates) + coordinates = coordinates.reshape(self._coordinates.shape) + transform = transforms.IdentityTransform() + else: + coordinates = self._coordinates + if not transOffset.is_affine: offsets = transOffset.transform_non_affine(offsets) transOffset = transOffset.get_affine() renderer.draw_quad_mesh( transform.frozen(), self.clipbox, clippath, clippath_trans, - self._meshWidth, self._meshHeight, self._coordinates, + self._meshWidth, self._meshHeight, coordinates, offsets, transOffset, self._facecolors, self._antialiased, self._showedges) renderer.close_group(self.__class__.__name__) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |