From: <jd...@us...> - 2009-09-08 01:46:48
|
Revision: 7705 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7705&view=rev Author: jdh2358 Date: 2009-09-08 01:46:42 +0000 (Tue, 08 Sep 2009) Log Message: ----------- add basic image interp unit test Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png trunk/matplotlib/lib/matplotlib/tests/test_image.py Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png =================================================================== (Binary files differ) Property changes on: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_image/image_interps.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/matplotlib/lib/matplotlib/tests/test_image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_image.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/test_image.py 2009-09-08 01:46:42 UTC (rev 7705) @@ -0,0 +1,31 @@ +import numpy as np + +from matplotlib.testing.decorators import image_comparison, knownfailureif +import matplotlib.pyplot as plt +from nose.tools import assert_raises + +@image_comparison(baseline_images=['image_interps']) +def test_image_interps(): + 'make the basic nearest, bilinear and bicubic interps' + X = np.arange(100) + X = X.reshape(5, 20) + + fig = plt.figure() + ax1 = fig.add_subplot(311) + ax1.imshow(X, interpolation='nearest') + ax1.set_title('three interpolations') + ax1.set_ylabel('nearest') + + ax2 = fig.add_subplot(312) + ax2.imshow(X, interpolation='bilinear') + ax2.set_ylabel('bilinear') + + ax3 = fig.add_subplot(313) + ax3.imshow(X, interpolation='bicubic') + ax3.set_ylabel('bicubic') + + fig.savefig('image_interps') + +if __name__=='__main__': + import nose + nose.runmodule(argv=['-s','--with-doctest'], exit=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |