1111
1212import datetime
1313
14+ import pytz
15+
1416import numpy as np
1517from numpy import ma
1618from numpy import arange
@@ -4213,6 +4215,7 @@ def test_pandas_indexing_hist():
42134215 fig , axes = plt .subplots ()
42144216 axes .hist (ser_2 )
42154217
4218+
42164219@cleanup
42174220def test_axis_set_tick_params_labelsize_labelcolor ():
42184221 # Tests fix for issue 4346
@@ -4225,6 +4228,58 @@ def test_axis_set_tick_params_labelsize_labelcolor():
42254228 assert axis_1 .yaxis .majorTicks [0 ]._labelsize == 30.0
42264229 assert axis_1 .yaxis .majorTicks [0 ]._labelcolor == 'red'
10000
42274230
4231+
4232+ @image_comparison (baseline_images = ['date_timezone_x' ], extensions = ['png' ])
4233+ def test_date_timezone_x ():
4234+ # Tests issue 5575
4235+ time_index = [pytz .timezone ('Canada/Eastern' ).localize (datetime .datetime (
4236+ year = 2016 , month = 2 , day = 22 , hour = x )) for x in range (3 )]
4237+
4238+ # Same Timezone
4239+ fig = plt .figure (figsize = (20 , 12 ))
4240+ plt .subplot (2 , 1 , 1 )
4241+ plt .plot_date (time_index , [3 ] * 3 , tz = 'Canada/Eastern' )
4242+
4243+ # Different Timezone
4244+ plt .subplot (2 , 1 , 2 )
4245+ plt .plot_date (time_index , [3 ] * 3 , tz = 'UTC' )
4246+
4247+
4248+ @image_comparison (baseline_images = ['date_timezone_y' ],
4249+ extensions = ['png' ])
4250+ def test_date_timezone_y ():
4251+ # Tests issue 5575
4252+ time_index = [pytz .timezone ('Canada/Eastern' ).localize (datetime .datetime (
4253+ year = 2016 , month = 2 , day = 22 , hour = x )) for x in range (3 )]
4254+
4255+ # Same Timezone
4256+ fig = plt .figure (figsize = (20 , 12 ))
4257+ plt .subplot (2 , 1 , 1 )
4258+ plt .plot_date ([3 ] * 3 ,
4259+ time_index , tz = 'Canada/Eastern' , xdate = False , ydate = True )
4260+
4261+ # Different Timezone
4262+ plt .subplot (2 , 1 , 2 )
4263+ plt .plot_date ([3 ] * 3 , time_index , tz = 'UTC' , xdate = False , ydate = True )
4264+
4265+
4266+ @image_comparison (baseline_images = ['date_timezone_x_and_y' ],
4267+ extensions = ['png' ])
4268+ def test_date_timezone_x_and_y ():
4269+ # Tests issue 5575
4270+ time_index = [pytz .timezone ('UTC' ).localize (datetime .datetime (
4271+ year = 2016 , month = 2 , day = 22 , hour = x )) for x in range (3 )]
4272+
4273+ # Same Timezone
4274+ fig = plt .figure (figsize = (20 , 12 ))
4275+ plt .subplot (2 , 1 , 1 )
4276+ plt .plot_date (time_index , time_index , tz = 'UTC' , ydate = True )
4277+
4278+ # Different Timezone
4279+ plt .subplot (2 , 1 , 2 )
4280+ plt .plot_date (time_index , time_index , tz = 'US/Eastern' , ydate = True )
4281+
4282+
42284283if __name__ == '__main__' :
42294284 import nose
42304285 import sys
0 commit comments