Skip to content

Commit 5697d73

Browse files
authored
Merge pull request matplotlib#14798 from anntzer/datesdoc
Cleanup dates.py module docstrings.
2 parents 1636987 + 1c7bf8b commit 5697d73

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:
@@ -44,10 +44,10 @@
4444
Out[1]: 732401
4545
4646
All the Matplotlib date converters, tickers and formatters are timezone aware.
47-
If no explicit timezone is provided, the rcParam ``timezone`` is assumed. If
48-
you want to use a custom time zone, pass a :class:`datetime.tzinfo` instance
49-
with the tz keyword argument to :func:`num2date`, :func:`.plot_date`, and any
50-
custom date tickers or locators you create.
47+
If no explicit timezone is provided, :rc:`timezone` is assumed. If you want to
48+
use a custom time zone, pass a `datetime.tzinfo` instance with the tz keyword
49+
argument to `num2date`, `~.Axes.plot_date`, and any custom date tickers or
50+
locators you create.
5151
5252
A wide range of specific and general purpose date tick locators and
5353
formatters are provided in this module. See
@@ -85,54 +85,51 @@
8585
rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
8686
loc = RRuleLocator(rule)
8787
88-
Here are all the date tickers:
88+
The available date tickers are:
8989
90-
* :class:`MicrosecondLocator`: locate microseconds
90+
* `MicrosecondLocator`: locate microseconds
9191
92-
* :class:`SecondLocator`: locate seconds
92+
* `SecondLocator`: locate seconds
9393
94-
* :class:`MinuteLocator`: locate minutes
94+
* `MinuteLocator`: locate minutes
9595
96-
* :class:`HourLocator`: locate hours
96+
* `HourLocator`: locate hours
9797
98-
* :class:`DayLocator`: locate specified days of the month
98+
* `DayLocator`: locate specified days of the month
9999
100-
* :class:`WeekdayLocator`: Locate days of the week, e.g., MO, TU
100+
* `WeekdayLocator`: Locate days of the week, e.g., MO, TU
101101
102-
* :class:`MonthLocator`: locate months, e.g., 7 for july
102+
* `MonthLocator`: locate months, e.g., 7 for july
103103
104-
* :class:`YearLocator`: locate years that are multiples of base
104+
* `YearLocator`: locate years that are multiples of base
105105
106-
* :class:`RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`.
107-
`.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule`
108-
which allow almost arbitrary date tick specifications. See :doc:`rrule
109-
example </gallery/ticks_and_spines/date_demo_rrule>`.
106+
* `RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`.
107+
`.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule` which
108+
allow almost arbitrary date tick specifications. See :doc:`rrule example
109+
</gallery/ticks_and_spines/date_demo_rrule>`.
110110
111-
* :class:`AutoDateLocator`: On autoscale, this class picks the best
112-
:class:`DateLocator` (e.g., :class:`RRuleLocator`)
113-
to set the view limits and the tick
114-
locations. If called with ``interval_multiples=True`` it will
115-
make ticks line up with sensible multiples of the tick intervals. E.g.
116-
if the interval is 4 hours, it will pick hours 0, 4, 8, etc as ticks.
117-
This behaviour is not guaranteed by default.
111+
* `AutoDateLocator`: On autoscale, this class picks the best `DateLocator`
112+
(e.g., `RRuleLocator`) to set the view limits and the tick locations. If
113+
called with ``interval_multiples=True`` it will make ticks line up with
114+
sensible multiples of the tick intervals. E.g. if the interval is 4 hours,
115+
it will pick hours 0, 4, 8, etc as ticks. This behaviour is not guaranteed
116+
by default.
118117
119118
Date formatters
120119
---------------
121120
122-
Here all all the date formatters:
121+
The available date formatters are:
123122
124-
* :class:`AutoDateFormatter`: attempts to figure out the best format
125-
to use. This is most useful when used with the :class:`AutoDateLocator`.
123+
* `AutoDateFormatter`: attempts to figure out the best format to use. This is
124+
most useful when used with the `AutoDateLocator`.
126125
127-
* :class:`ConciseDateFormatter`: also attempts to figure out the best
128-
format to use, and to make the format as compact as possible while
129-
still having complete date information. This is most useful when used
130-
with the :class:`AutoDateLocator`.
126+
* `ConciseDateFormatter`: also attempts to figure out the best format to use,
127+
and to make the format as compact as possible while still having complete
128+
date information. This is most useful when used with the `AutoDateLocator`.
131129
132-
* :class:`DateFormatter`: use :func:`strftime` format strings
130+
* `DateFormatter`: use `strftime` format strings.
133131
134-
* :class:`IndexDateFormatter`: date plots with implicit *x*
135-
indexing.
132+
* `IndexDateFormatter`: date plots with implicit *x* indexing.
136133
"""
137134

138135
import datetime

0 commit comments

Comments
 (0)