From 27d2bf8c0db426959d3128176d26de29d6535265 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sun, 12 Jan 2014 19:51:03 -0600 Subject: [PATCH] DOC : fixes small typos in matplotlib.dates docs - added explicit import for day of week alias - fixed dateutils -> dateutil type closes issue #2724 --- lib/matplotlib/dates.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index bcae61aaee40..29ce2b4d5954 100755 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -2,7 +2,7 @@ """ Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python :mod:`datetime`, the add-on modules :mod:`pytz` and -:mod:`dateutils`. :class:`datetime` objects are converted to floating point +:mod:`dateutil`. :class:`datetime` objects are converted to floating point numbers which represent time in days since 0001-01-01 UTC, plus 1. For example, 0001-01-01, 06:00 is 1.25, not 0.25. The helper functions :func:`date2num`, :func:`num2date` and :func:`drange` are used to facilitate @@ -50,6 +50,9 @@ Most of the date tickers can locate single or multiple values. For example:: + # import constants for the days of the week + from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU + # tick on mondays every week loc = WeekdayLocator(byweekday=MO, tz=tz) @@ -1028,7 +1031,8 @@ def __init__(self, byweekday=1, interval=1, tz=None): sequence. Elements of *byweekday* must be one of MO, TU, WE, TH, FR, SA, - SU, the constants from :mod:`dateutils.rrule`. + SU, the constants from :mod:`dateutil.rrule`, which have been + imported into the :mod:`matplotlib.dates` namespace. *interval* specifies the number of weeks to skip. For example, ``interval=2`` plots every second week.