From: <jd...@us...> - 2008-12-17 14:55:46
|
Revision: 6647 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6647&view=rev Author: jdh2358 Date: 2008-12-17 14:55:42 +0000 (Wed, 17 Dec 2008) Log Message: ----------- fix to figimage Modified Paths: -------------- branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py branches/v0_98_5_maint/lib/matplotlib/image.py Modified: branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py =================================================================== --- branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 12:59:50 UTC (rev 6646) +++ branches/v0_98_5_maint/examples/pylab_examples/figimage_demo.py 2008-12-17 14:55:42 UTC (rev 6647) @@ -7,7 +7,7 @@ import matplotlib.pyplot as plt -fig = plt.figure(frameon=False) +fig = plt.figure() Z = np.arange(10000.0) Z.shape = 100,100 Z[:,50:] = 1. @@ -15,11 +15,13 @@ im1 = plt.figimage(Z, xo=50, yo=0, cmap=cm.jet, origin='lower') im2 = plt.figimage(Z, xo=100, yo=100, alpha=.8, cmap=cm.jet, origin='lower') -dpi = 200 -plt.savefig('figimage.png', dpi=dpi) -plt.savefig('figimage.pdf', dpi=dpi) -plt.savefig('figimage.svg', dpi=dpi) -plt.savefig('figimage.eps', dpi=dpi) + +if 0: + dpi = 72 + plt.savefig('figimage_%d.png'%dpi, dpi=dpi, facecolor='gray') + plt.savefig('figimage_%d.pdf'%dpi, dpi=dpi, facecolor='gray') + plt.savefig('figimage_%d.svg'%dpi, dpi=dpi, facecolor='gray') + plt.savefig('figimage_%d.eps'%dpi, dpi=dpi, facecolor='gray') plt.show() Modified: branches/v0_98_5_maint/lib/matplotlib/image.py =================================================================== --- branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 12:59:50 UTC (rev 6646) +++ branches/v0_98_5_maint/lib/matplotlib/image.py 2008-12-17 14:55:42 UTC (rev 6647) @@ -693,7 +693,7 @@ if not self.get_visible(): return # todo: we should be able to do some cacheing here im = self.make_image(renderer.get_image_magnification()) - renderer.draw_image(round(self.ox/self.magnification), round(self.oy/self.magnification), im, self.figure.bbox, + renderer.draw_image(round(self.ox), round(self.oy), im, self.figure.bbox, *self.get_transformed_clip_path_and_affine()) def write_png(self, fname): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |