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. |
From: <as...@us...> - 2009-09-07 17:18:58
|
Revision: 7675 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7675&view=rev Author: astraw Date: 2009-09-07 17:18:44 +0000 (Mon, 07 Sep 2009) Log Message: ----------- testing: add test for bug SF#2715172 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-07 16:57:36 UTC (rev 7674) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009-09-07 17:18:44 UTC (rev 7675) @@ -66,6 +66,25 @@ fig.autofmt_xdate() fig.savefig('date_axvline') +@image_comparison(baseline_images=['date_xlim_empty']) +def test_set_xlim_and_unexpected_handling(): + # Attempt to test SF 2715172, see + # https://sourceforge.net/tracker/?func=detail&aid=2715172&group_id=80706&atid=560720 + t0 = datetime.datetime(2000, 1, 20) + tf = datetime.datetime(2000, 1, 20) + fig = plt.figure() + ax = fig.add_subplot(1,1,1) + ax.set_xlim((t0,tf)) + ax.plot([],[]) + from matplotlib.dates import DayLocator, DateFormatter, HourLocator + ax.xaxis.set_major_locator(DayLocator()) + ax.xaxis.set_major_formatter(DateFormatter("%m/%d/%y, %I:%M%p")) + ax.xaxis.set_minor_locator(HourLocator()) + if 1: + # this seems to cause an ininite loop. + from nose.plugins.skip import SkipTest + raise SkipTest('avoiding never-ending drawing') + fig.savefig('date_xlim_empty') if __name__=='__main__': import nose This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2009-09-18 14:05:59
|
Revision: 7782 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7782&view=rev Author: jdh2358 Date: 2009-09-18 14:05:51 +0000 (Fri, 18 Sep 2009) Log Message: ----------- add unit test for sf bug 2861426; empty date plot with year formatter 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-18 02:50:37 UTC (rev 7781) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009-09-18 14:05:51 UTC (rev 7782) @@ -141,6 +141,20 @@ fig.savefig( 'DateFormatter_fractionalSeconds' ) +#@image_comparison(baseline_images=['empty_date_bug']) +@knownfailureif(True) +def empty_date_with_year_formatter(): + # exposes sf bug 2861426: https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 + import matplotlib.dates as dates + + fig = plt.figure() + ax = fig.add_subplot(111) + + yearFmt = dates.DateFormatter('%Y') + ax.xaxis.set_major_formatter(yearFmt) + + fig.savefig('empty_date_bug') + 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. |
From: <jd...@us...> - 2009-09-18 14:28:46
|
Revision: 7783 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7783&view=rev Author: jdh2358 Date: 2009-09-18 14:28:39 +0000 (Fri, 18 Sep 2009) Log Message: ----------- add unit test for sf bug 2861426; empty date plot with year formatter; need test in the name 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-18 14:05:51 UTC (rev 7782) +++ trunk/matplotlib/lib/matplotlib/tests/test_dates.py 2009-09-18 14:28:39 UTC (rev 7783) @@ -143,7 +143,7 @@ #@image_comparison(baseline_images=['empty_date_bug']) @knownfailureif(True) -def empty_date_with_year_formatter(): +def test_empty_date_with_year_formatter(): # exposes sf bug 2861426: https://sourceforge.net/tracker/?func=detail&aid=2861426&group_id=80706&atid=560720 import matplotlib.dates as dates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |