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

Skip to content

Commit 0d77914

Browse files
committed
Cleanup dates docstrings.
Inherit some docstrings. Fix capitalization, line-wrapping.
1 parent 8e87493 commit 0d77914

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

lib/matplotlib/dates.py

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Matplotlib provides sophisticated date plotting capabilities, standing on the
33
shoulders of python :mod:`datetime` and the add-on module :mod:`dateutil`.
44
5-
65
.. _date-format:
76
87
Matplotlib date format
@@ -62,8 +61,7 @@
6261
Date tickers
6362
------------
6463
65-
Most of the date tickers can locate single or multiple values. For
66-
example::
64+
Most of the date tickers can locate single or multiple values. For example::
6765
6866
# import constants for the days of the week
6967
from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
@@ -87,23 +85,23 @@
8785
8886
The available date tickers are:
8987
90-
* `MicrosecondLocator`: locate microseconds
88+
* `MicrosecondLocator`: Locate microseconds.
9189
92-
* `SecondLocator`: locate seconds
90+
* `SecondLocator`: Locate seconds.
9391
94-
* `MinuteLocator`: locate minutes
92+
* `MinuteLocator`: Locate minutes.
9593
96-
* `HourLocator`: locate hours
94+
* `HourLocator`: Locate hours.
9795
98-
* `DayLocator`: locate specified days of the month
96+
* `DayLocator`: Locate specified days of the month.
9997
100-
* `WeekdayLocator`: Locate days of the week, e.g., MO, TU
98+
* `WeekdayLocator`: Locate days of the week, e.g., MO, TU.
10199
102-
* `MonthLocator`: locate months, e.g., 7 for july
100+
* `MonthLocator`: Locate months, e.g., 7 for July.
103101
104-
* `YearLocator`: locate years that are multiples of base
102+
* `YearLocator`: Locate years that are multiples of base.
105103
106-
* `RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`.
104+
* `RRuleLocator`: Locate using a `matplotlib.dates.rrulewrapper`.
107105
`.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule` which
108106
allow almost arbitrary date tick specifications. See :doc:`rrule example
109107
</gallery/ticks_and_spines/date_demo_rrule>`.
@@ -208,7 +206,7 @@ def _to_ordinalf(dt):
208206
"""
209207
Convert :mod:`datetime` or :mod:`date` to the Gregorian date as UTC float
210208
days, preserving hours, minutes, seconds and microseconds. Return value
211-
is a :func:`float`.
209+
is a `float`.
212210
"""
213211
# Convert to UTC
214212
tzi = getattr(dt, 'tzinfo', None)
@@ -1093,10 +1091,7 @@ def tick_values(self, vmin, vmax):
10931091
return self.raise_if_exceeds(date2num(dates))
10941092

10951093
def _get_unit(self):
1096-
"""
1097-
Return how many days a unit of the locator is; used for
1098-
intelligent autoscaling.
1099-
"""
1094+
# docstring inherited
11001095
freq = self.rule._rrule._freq
11011096
return self.get_unit_generic(freq)
11021097

@@ -1679,16 +1674,11 @@ def tick_values(self, vmin, vmax):
16791674
return ticks
16801675

16811676
def _get_unit(self):
1682-
"""
1683-
Return how many days a unit of the locator is; used for
1684-
intelligent autoscaling.
1685-
"""
1677+
# docstring inherited
16861678
return 1. / MUSECONDS_PER_DAY
16871679

16881680
def _get_interval(self):
1689-
"""
1690-
Return the number of units for each tick.
1691-
"""
1681+
# docstring inherited
16921682
return self._interval
16931683

16941684

0 commit comments

Comments
 (0)