Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 245039b

Browse files
committed
FIX: properly set tz for YearLocator
1 parent ad779b4 commit 245039b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def __init__(self, tz=None, minticks=5, maxticks=None,
11831183
locator.intervald[HOURLY] = [3] # only show every 3 hours
11841184
"""
11851185
DateLocator.__init__(self, tz)
1186-
self._locator = YearLocator()
1186+
self._locator = YearLocator(tz=tz)
11871187
self._freq = YEARLY
11881188
self._freqs = [YEARLY, MONTHLY, DAILY, HOURLY, MINUTELY,
11891189
SECONDLY, MICROSECONDLY]
@@ -1338,7 +1338,7 @@ def get_locator(self, dmin, dmax):
13381338
'AutoDateLocator.')
13391339

13401340
if (freq == YEARLY) and self.interval_multiples:
1341-
locator = YearLocator(interval)
1341+
locator = YearLocator(interval, tz=self.tz)
13421342
elif use_rrule_locator[i]:
13431343
_, bymonth, bymonthday, byhour, byminute, bysecond, _ = byranges
13441344
rrule = rrulewrapper(self._freq, interval=interval,

0 commit comments

Comments
 (0)