11
11
12
12
import datetime
13
13
14
+ import pytz
15
+
14
16
import numpy as np
15
17
from numpy import ma
16
18
from numpy import arange
@@ -4213,6 +4215,7 @@ def test_pandas_indexing_hist():
4213
4215
fig , axes = plt .subplots ()
4214
4216
axes .hist (ser_2 )
4215
4217
4218
+
4216
4219
@cleanup
4217
4220
def test_axis_set_tick_params_labelsize_labelcolor ():
4218
4221
# Tests fix for issue 4346
@@ -4225,6 +4228,58 @@ def test_axis_set_tick_params_labelsize_labelcolor():
4225
4228
assert axis_1 .yaxis .majorTicks [0 ]._labelsize == 30.0
4226
4229
assert axis_1 .yaxis .majorTicks [0 ]._labelcolor == 'red'
4227
4230
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
+
4228
4283
if __name__ == '__main__' :
4229
4284
import nose
4230
4285
import sys
0 commit comments