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

Skip to content

Commit ee51a91

Browse files
committed
Merge pull request matplotlib#2083 from pelson/longer_date
Added a wider range of day ranges for the AutoDateLocator.
2 parents 356cb4c + 415a4b8 commit ee51a91

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/matplotlib/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def __init__(self, tz=None, minticks=5, maxticks=None,
787787
YEARLY: [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
788788
1000, 2000, 4000, 5000, 10000],
789789
MONTHLY: [1, 2, 3, 4, 6],
790-
DAILY: [1, 2, 3, 7, 14],
790+
DAILY: [1, 2, 3, 7, 14, 21],
791791
HOURLY: [1, 2, 3, 4, 6, 12],
792792
MINUTELY: [1, 5, 10, 15, 30],
793793
SECONDLY: [1, 5, 10, 15, 30],

lib/matplotlib/tests/test_dates.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ def _create_auto_date_locator(date1, date2):
222222
'1990-09-01 00:00:00+00:00', '1990-10-01 00:00:00+00:00',
223223
'1990-11-01 00:00:00+00:00', '1990-12-01 00:00:00+00:00']
224224
],
225+
[datetime.timedelta(days=140),
226+
['1990-01-06 00:00:00+00:00', '1990-01-27 00:00:00+00:00',
227+
'1990-02-17 00:00:00+00:00', '1990-03-10 00:00:00+00:00',
228+
'1990-03-31 00:00:00+00:00', '1990-04-21 00:00:00+00:00',
229+
'1990-05-12 00:00:00+00:00']
230+
],
225231
[datetime.timedelta(days=40),
226232
['1990-01-03 00:00:00+00:00', '1990-01-10 00:00:00+00:00',
227233
'1990-01-17 00:00:00+00:00', '1990-01-24 00:00:00+00:00',

0 commit comments

Comments
 (0)