@@ -79,6 +79,14 @@ def _warn_set_ylim_deprecated(value):
79
79
category = DeprecationWarning )
80
80
return isinstance (value ,bool )
81
81
82
+ def _tzinfo_dates (dates ,tzinfo = None ):
83
+ if tzinfo != None : # assume 'UTC'; later implement others
84
+ return dates
85
+ dts = copy .deepcopy (dates )
86
+ for ix , d in enumerate (dts ):
87
+ dts [ix ] = d .replace (tzinfo )
88
+ return dts
89
+
82
90
83
91
def _valid_plot_kwargs ():
84
92
'''
@@ -255,7 +263,10 @@ def _valid_plot_kwargs():
255
263
'Validator' : lambda value : isinstance (value ,mpl_axes .Axes ) },
256
264
257
265
'volume_exponent' : { 'Default' : None ,
258
- 'Validator' : lambda value : isinstance (value ,int ) or value == 'legacy' },
266
+ 'Validator' : lambda value : isinstance (value ,int ) or value == 'legacy' },
267
+
268
+ 'tzinfo' : { 'Default' : None ,
269
+ 'Validator' : lambda value : isinstance (value ,string ) },
259
270
}
260
271
261
272
_validate_vkwargs_dict (vkwargs )
@@ -349,9 +360,9 @@ def plot( data, **kwargs ):
349
360
350
361
if config ['show_nontrading' ]:
351
362
formatter = mdates .DateFormatter (fmtstring )
352
- xdates = dates
363
+ xdates = _tzinfo_dates ( dates , tzinfo = config [ 'tzinfo' ])
353
364
else :
354
- formatter = IntegerIndexDateTimeFormatter (dates , fmtstring )
365
+ formatter = IntegerIndexDateTimeFormatter (_tzinfo_dates ( dates ,tzinfo = config [ 'tzinfo' ]), fmtstring )
355
366
xdates = np .arange (len (dates ))
356
367
357
368
if external_axes_mode :
0 commit comments