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

Skip to content

Commit 7c994b8

Browse files
committed
DOC: add small comments
1 parent 666cf14 commit 7c994b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/dates.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,9 @@ def __init__(self, tz=None, minticks=5, maxticks=None,
12351235
5000, 10000, 20000, 50000, 100000, 200000, 500000,
12361236
1000000]}
12371237
if interval_multiples:
1238+
# Swap "3" for "4" in the DAILY list; If we use 3 we get bad
1239+
# tick loc for months w/ 31 days: 1, 4,..., 28, 31, 1
1240+
# If we use 4 then we get: 1, 5, ... 25, 29, 1
12381241
self.intervald[DAILY] = [1, 2, 4, 7, 14, 21]
12391242

12401243
self._byranges = [None, range(1, 13), range(1, 32),
@@ -1341,8 +1344,9 @@ def get_locator(self, dmin, dmax):
13411344
self._freq = freq
13421345

13431346
if self._byranges[i] and self.interval_multiples:
1344-
if i == 2 and interval == 14:
1345-
byranges[i] = [1, 15]
1347+
if i == DAILY and interval == 14:
1348+
# just make first and 15th. Avoids 30th.
1349+
byranges[i] = [1, 15]
13461350
else:
13471351
byranges[i] = self._byranges[i][::interval]
13481352
interval = 1

0 commit comments

Comments
 (0)