From: <as...@us...> - 2009-09-07 20:04:48
|
Revision: 7692 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7692&view=rev Author: astraw Date: 2009-09-07 20:04:38 +0000 (Mon, 07 Sep 2009) Log Message: ----------- test conversion: move old-style test to new-style test Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_axes.py trunk/matplotlib/test/test_plots/TestPolar.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png Removed Paths: ------------- trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_180.png (from rev 7691, trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png) =================================================================== (Binary files differ) Copied: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_wrap_360.png (from rev 7691, trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png) =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/test_axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-09-07 20:04:20 UTC (rev 7691) +++ trunk/matplotlib/lib/matplotlib/tests/test_axes.py 2009-09-07 20:04:38 UTC (rev 7692) @@ -259,3 +259,32 @@ pylab.plot( np.ones( (10,) ), np.ones( (10,) ), 'o' ) fig.savefig( 'const_xy' ) + +@image_comparison(baseline_images=['polar_wrap_180', + 'polar_wrap_360', + ]) +def test_polar_wrap(): + """Test polar plots where data crosses 0 degrees.""" + + D2R = np.pi / 180.0 + + fig = pylab.figure() + + #NOTE: resolution=1 really should be the default + pylab.subplot( 111, polar=True, resolution=1 ) + pylab.polar( [179*D2R, -179*D2R], [0.2, 0.1], "b.-" ) + pylab.polar( [179*D2R, 181*D2R], [0.2, 0.1], "g.-" ) + pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) + + fig.savefig( 'polar_wrap_180' ) + + fig = pylab.figure() + + #NOTE: resolution=1 really should be the default + pylab.subplot( 111, polar=True, resolution=1 ) + pylab.polar( [2*D2R, -2*D2R], [0.2, 0.1], "b.-" ) + pylab.polar( [2*D2R, 358*D2R], [0.2, 0.1], "g.-" ) + pylab.polar( [358*D2R, 2*D2R], [0.2, 0.1], "r.-" ) + pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) + + fig.savefig( 'polar_wrap_360' ) Modified: trunk/matplotlib/test/test_plots/TestPolar.py =================================================================== --- trunk/matplotlib/test/test_plots/TestPolar.py 2009-09-07 20:04:20 UTC (rev 7691) +++ trunk/matplotlib/test/test_plots/TestPolar.py 2009-09-07 20:04:38 UTC (rev 7692) @@ -41,40 +41,6 @@ pass #-------------------------------------------------------------------- - def test_polar_wrap( self ): - """Test polar plots where data crosses 0 degrees.""" - - fname = self.outFile( "polar_wrap_180.png" ) - - D2R = npy.pi / 180.0 - - fig = pylab.figure() - - #NOTE: resolution=1 really should be the default - pylab.subplot( 111, polar=True, resolution=1 ) - pylab.polar( [179*D2R, -179*D2R], [0.2, 0.1], "b.-" ) - pylab.polar( [179*D2R, 181*D2R], [0.2, 0.1], "g.-" ) - pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) - - fig.savefig( fname ) - self.checkImage( fname ) - - - fname = self.outFile( "polar_wrap_360.png" ) - - fig = pylab.figure() - - #NOTE: resolution=1 really should be the default - pylab.subplot( 111, polar=True, resolution=1 ) - pylab.polar( [2*D2R, -2*D2R], [0.2, 0.1], "b.-" ) - pylab.polar( [2*D2R, 358*D2R], [0.2, 0.1], "g.-" ) - pylab.polar( [358*D2R, 2*D2R], [0.2, 0.1], "r.-" ) - pylab.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] ) - - fig.savefig( fname ) - self.checkImage( fname ) - - #-------------------------------------------------------------------- def test_polar_units( self ): """Test polar plots with unitized data.""" Deleted: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_180.png =================================================================== (Binary files differ) Deleted: trunk/matplotlib/test/test_plots/baseline/TestPolar/polar_wrap_360.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |