From: <jd...@us...> - 2009-09-06 21:55:49
|
Revision: 7662 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7662&view=rev Author: jdh2358 Date: 2009-09-06 21:55:38 +0000 (Sun, 06 Sep 2009) Log Message: ----------- fix the test_date images Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/test_dates.py Modified: trunk/matplotlib/lib/matplotlib/tests/test_dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009-09-06 21:16:27 UTC (rev 7661) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009-09-06 21:55:38 UTC (rev 7662) @@ -1,19 +1,17 @@ import datetime import numpy as np -import matplotlib -matplotlib.use('Agg') from matplotlib.testing.decorators import image_comparison import matplotlib.pyplot as plt -@image_comparison(baseline_images=['empty_datetime.png']) -def test_empty_datetime(): +@image_comparison(baseline_images=['date_empty.png']) +def test_date_empty(): # make sure mpl does the right thing when told to plot dates even # if no date data has been presented, cf # http://sourceforge.net/tracker/?func=detail&aid=2850075&group_id=80706&atid=560720 fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.xaxis_date() - fig.savefig('empty_datetime.png') + fig.savefig('date_empty.png') @image_comparison(baseline_images=['date_axhspan.png']) def test_date_axhspan(): @@ -23,9 +21,9 @@ fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.axhspan( t0, tf, facecolor="blue", alpha=0.25 ) - ax.set_xlim(t0-datetime.timedelta(days=5), + ax.set_ylim(t0-datetime.timedelta(days=5), tf+datetime.timedelta(days=5)) - fig.autofmt_xdate() + fig.subplots_adjust(left=0.25) fig.savefig('date_axhspan.png') @image_comparison(baseline_images=['date_axvspan.png']) @@ -36,8 +34,8 @@ fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.axvspan( t0, tf, facecolor="blue", alpha=0.25 ) - ax.set_xlim(t0-datetime.timedelta(days=5), - tf+datetime.timedelta(days=5)) + ax.set_xlim(t0-datetime.timedelta(days=720), + tf+datetime.timedelta(days=720)) fig.autofmt_xdate() fig.savefig('date_axvspan.png') @@ -49,20 +47,20 @@ tf = datetime.datetime(2009, 1, 31) fig = plt.figure() ax = fig.add_subplot(1,1,1) - ax.axhline( t0, tf, facecolor="blue", lw=3) - ax.set_xlim(t0-datetime.timedelta(days=5), + ax.axhline( t0, color="blue", lw=3) + ax.set_ylim(t0-datetime.timedelta(days=5), tf+datetime.timedelta(days=5)) - fig.autofmt_xdate() + fig.subplots_adjust(left=0.25) fig.savefig('date_axhline.png') @image_comparison(baseline_images=['date_axvline.png']) def test_date_axvline(): # test ax hline with date inputs t0 = datetime.datetime(2000, 1, 20) - tf = datetime.datetime(2010, 1, 21) + tf = datetime.datetime(2000, 1, 21) fig = plt.figure() ax = fig.add_subplot(1,1,1) - ax.axvline( t0, tf, facecolor="blue", lw=3) + ax.axvline( t0, color="red", lw=3) ax.set_xlim(t0-datetime.timedelta(days=5), tf+datetime.timedelta(days=5)) fig.autofmt_xdate() @@ -74,3 +72,4 @@ 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. |