Skip to content

Commit 1c7bf8b

Browse files
committed
Cleanup dates.py module docstrings.
1 parent 886983d commit 1c7bf8b

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

lib/matplotlib/dates.py

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
----------------------
1010
Matplotlib represents dates using floating point numbers specifying the number
1111
of days since 0001-01-01 UTC, plus 1. For example, 0001-01-01, 06:00 is 1.25,
12-
not 0.25. Values < 1, i.e. dates before 0001-01-01 UTC are not supported.
12+
not 0.25. Values < 1, i.e. dates before 0001-01-01 UTC, are not supported.
1313
1414
There are a number of helper functions to convert between :mod:`datetime`
1515
objects and Matplotlib dates:
@@ -45,10 +45,10 @@
4545
Out[1]: 732401
4646
4747
All the Matplotlib date converters, tickers and formatters are timezone aware.
48-
If no explicit timezone is provided, the rcParam ``timezone`` is assumed. If
49-
you want to use a custom time zone, pass a :class:`datetime.tzinfo` instance
50-
with the tz keyword argument to :func:`num2date`, :func:`.plot_date`, and any
51-
custom date tickers or locators you create.
48+
If no explicit timezone is provided, :rc:`timezone` is assumed. If you want to
49+
use a custom time zone, pass a `datetime.tzinfo` instance with the tz keyword
50+
argument to `num2date`, `~.Axes.plot_date`, and any custom date tickers or
51+
locators you create.
5252
5353
A wide range of specific and general purpose date tick locators and
5454
formatters are provided in this module. See
@@ -86,54 +86,51 @@
8686
rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
8787
loc = RRuleLocator(rule)
8888
89-
Here are all the date tickers:
89+
The available date tickers are:
9090
91-
* :class:`MicrosecondLocator`: locate microseconds
91+
* `MicrosecondLocator`: locate microseconds
9292
93-
* :class:`SecondLocator`: locate seconds
93+
* `SecondLocator`: locate seconds
9494
95-
* :class:`MinuteLocator`: locate minutes
95+
* `MinuteLocator`: locate minutes
9696
97-
* :class:`HourLocator`: locate hours
97+
* `HourLocator`: locate hours
9898
99-
* :class:`DayLocator`: locate specified days of the month
99+
* `DayLocator`: locate specified days of the month
100100
101-
* :class:`WeekdayLocator`: Locate days of the week, e.g., MO, TU
101+
* `WeekdayLocator`: Locate days of the week, e.g., MO, TU
102102
103-
* :class:`MonthLocator`: locate months, e.g., 7 for july
103+
* `MonthLocator`: locate months, e.g., 7 for july
104104
105-
* :class:`YearLocator`: locate years that are multiples of base
105+
* `YearLocator`: locate years that are multiples of base
106106
107-
* :class:`RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`.
108-
`.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule`
109-
which allow almost arbitrary date tick specifications. See :doc:`rrule
110-
example </gallery/ticks_and_spines/date_demo_rrule>`.
107+
* `RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`.
108+
`.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule` which
109+
allow almost arbitrary date tick specifications. See :doc:`rrule example
110+
</gallery/ticks_and_spines/date_demo_rrule>`.
111111
112-
* :class:`AutoDateLocator`: On autoscale, this class picks the best
113-
:class:`DateLocator` (e.g., :class:`RRuleLocator`)
114-
to set the view limits and the tick
115-
locations. If called with ``interval_multiples=True`` it will
116-
make ticks line up with sensible multiples of the tick intervals. E.g.
117-
if the interval is 4 hours, it will pick hours 0, 4, 8, etc as ticks.
118-
This behaviour is not guaranteed by default.
112+
* `AutoDateLocator`: On autoscale, this class picks the best `DateLocator`
113+
(e.g., `RRuleLocator`) to set the view limits and the tick locations. If
114+
called with ``interval_multiples=True`` it will make ticks line up with
115+
sensible multiples of the tick intervals. E.g. if the interval is 4 hours,
116+
it will pick hours 0, 4, 8, etc as ticks. This behaviour is not guaranteed
117+
by default.
119118
120119
Date formatters
121120
---------------
122121
123-
Here all all the date formatters:
122+
The available date formatters are:
124123
125-
* :class:`AutoDateFormatter`: attempts to figure out the best format
126-
to use. This is most useful when used with the :class:`AutoDateLocator`.
124+
* `AutoDateFormatter`: attempts to figure out the best format to use. This is
125+
most useful when used with the `AutoDateLocator`.
127126
128-
* :class:`ConciseDateFormatter`: also attempts to figure out the best
129-
format to use, and to make the format as compact as possible while
130-
still having complete date information. This is most useful when used
131-
with the :class:`AutoDateLocator`.
127+
* `ConciseDateFormatter`: also attempts to figure out the best format to use,
128+
and to make the format as compact as possible while still having complete
129+
date information. This is most useful when used with the `AutoDateLocator`.
132130
133-
* :class:`DateFormatter`: use :func:`strftime` format strings
131+
* `DateFormatter`: use `strftime` format strings.
134132
135-
* :class:`IndexDateFormatter`: date plots with implicit *x*
136-
indexing.
133+
* `IndexDateFormatter`: date plots with implicit *x* indexing.
137134
"""
138135

139136
import datetime

0 commit comments

Comments
 (0)