Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1fd575e

Browse files
committed
test conversion: move old-style test to new-style test
svn path=/trunk/matplotlib/; revision=7687
1 parent 029be1f commit 1fd575e

3 files changed

Lines changed: 42 additions & 87 deletions

File tree

test/test_plots/baseline/TestFill/fill_units.png renamed to lib/matplotlib/tests/baseline_images/test_axes/fill_units.png

File renamed without changes.

lib/matplotlib/tests/test_axes.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,45 @@ def test_polar_coord_annotations():
128128
ax.set_ylim( -20, 20 )
129129
fig.savefig( 'polar_coords' )
130130

131+
@image_comparison(baseline_images=['fill_units'])
132+
def test_fill_units():
133+
"""Test the fill method with unitized-data."""
134+
from datetime import datetime
135+
import matplotlib.testing.jpl_units as units
136+
units.register()
137+
138+
# generate some data
139+
t = units.Epoch( "ET", dt=datetime(2009, 4, 27) )
140+
value = 10.0 * units.deg
141+
day = units.Duration( "ET", 24.0 * 60.0 * 60.0 )
142+
143+
fig = pylab.figure()
144+
145+
# Top-Left
146+
ax1 = fig.add_subplot( 221 )
147+
ax1.plot( [t], [value], yunits='deg', color='red' )
148+
ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0],
149+
[0.0, 0.0, 90.0, 0.0], 'b' )
150+
151+
# Top-Right
152+
ax2 = fig.add_subplot( 222 )
153+
ax2.plot( [t], [value], yunits='deg', color='red' )
154+
ax2.fill( [t, t, t+day, t+day],
155+
[0.0, 0.0, 90.0, 0.0], 'b' )
156+
157+
# Bottom-Left
158+
ax3 = fig.add_subplot( 223 )
159+
ax3.plot( [t], [value], yunits='deg', color='red' )
160+
ax1.fill( [733525.0, 733525.0, 733526.0, 733526.0],
161+
[0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg], 'b' )
162+
163+
# Bottom-Right
164+
ax4 = fig.add_subplot( 224 )
165+
ax4.plot( [t], [value], yunits='deg', color='red' )
166+
ax4.fill( [t, t, t+day, t+day],
167+
[0*units.deg, 0*units.deg, 90*units.deg, 0*units.deg],
168+
facecolor="blue" )
169+
170+
fig.autofmt_xdate()
171+
fig.savefig( 'fill_units' )
172+

test/test_plots/TestFill.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)