The solution I found is giving the time zone info directly to theDateFormatter. #!/usr/bin/env python3# -*- coding: utf-8 -*-importnumpyasnpimportmatplotlib.pyplotaspltimportmatplotlib.datesasmdates"""Unix 1667332800GMT Tue Nov 01 2022 20:00:00 GMT+0000CET Tue Nov 01 2022 21:00:00...
python ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d')) 这行代码将x轴的主要刻度格式化为“年-月-日”的形式。 日期定位器: python ax.xaxis.set_major_locator(mdates.DayLocator(interval=1)) 这行代码将x轴的主要刻度定位在每天的间隔上。 自动日期定位器: python locator = mdate...
~\AppData\Roaming\Python\Python38\site-packages\mplfinance\_utils.py in __call__(self, x, pos) 1424 else: 1425 date = self.dates[ix] -> 1426 dateformat = mdates.num2date(date).strftime(self.fmt) 1427 #print('x=',x,'pos=',pos,'dates[',ix,']=',date,'dateformat=',dateform...