@@ -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+
0 commit comments