|
2 | 2 | Matplotlib provides sophisticated date plotting capabilities, standing on the
|
3 | 3 | shoulders of python :mod:`datetime` and the add-on module :mod:`dateutil`.
|
4 | 4 |
|
5 |
| -
|
6 | 5 | .. _date-format:
|
7 | 6 |
|
8 | 7 | Matplotlib date format
|
|
62 | 61 | Date tickers
|
63 | 62 | ------------
|
64 | 63 |
|
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:: |
67 | 65 |
|
68 | 66 | # import constants for the days of the week
|
69 | 67 | from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
|
|
87 | 85 |
|
88 | 86 | The available date tickers are:
|
89 | 87 |
|
90 |
| -* `MicrosecondLocator`: locate microseconds |
| 88 | +* `MicrosecondLocator`: Locate microseconds. |
91 | 89 |
|
92 |
| -* `SecondLocator`: locate seconds |
| 90 | +* `SecondLocator`: Locate seconds. |
93 | 91 |
|
94 |
| -* `MinuteLocator`: locate minutes |
| 92 | +* `MinuteLocator`: Locate minutes. |
95 | 93 |
|
96 |
| -* `HourLocator`: locate hours |
| 94 | +* `HourLocator`: Locate hours. |
97 | 95 |
|
98 |
| -* `DayLocator`: locate specified days of the month |
| 96 | +* `DayLocator`: Locate specified days of the month. |
99 | 97 |
|
100 |
| -* `WeekdayLocator`: Locate days of the week, e.g., MO, TU |
| 98 | +* `WeekdayLocator`: Locate days of the week, e.g., MO, TU. |
101 | 99 |
|
102 |
| -* `MonthLocator`: locate months, e.g., 7 for july |
| 100 | +* `MonthLocator`: Locate months, e.g., 7 for July. |
103 | 101 |
|
104 |
| -* `YearLocator`: locate years that are multiples of base |
| 102 | +* `YearLocator`: Locate years that are multiples of base. |
105 | 103 |
|
106 |
| -* `RRuleLocator`: locate using a `matplotlib.dates.rrulewrapper`. |
| 104 | +* `RRuleLocator`: Locate using a `matplotlib.dates.rrulewrapper`. |
107 | 105 | `.rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule` which
|
108 | 106 | allow almost arbitrary date tick specifications. See :doc:`rrule example
|
109 | 107 | </gallery/ticks_and_spines/date_demo_rrule>`.
|
@@ -208,7 +206,7 @@ def _to_ordinalf(dt):
|
208 | 206 | """
|
209 | 207 | Convert :mod:`datetime` or :mod:`date` to the Gregorian date as UTC float
|
210 | 208 | days, preserving hours, minutes, seconds and microseconds. Return value
|
211 |
| - is a :func:`float`. |
| 209 | + is a `float`. |
212 | 210 | """
|
213 | 211 | # Convert to UTC
|
214 | 212 | tzi = getattr(dt, 'tzinfo', None)
|
@@ -1093,10 +1091,7 @@ def tick_values(self, vmin, vmax):
|
1093 | 1091 | return self.raise_if_exceeds(date2num(dates))
|
1094 | 1092 |
|
1095 | 1093 | 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 |
1100 | 1095 | freq = self.rule._rrule._freq
|
1101 | 1096 | return self.get_unit_generic(freq)
|
1102 | 1097 |
|
@@ -1679,16 +1674,11 @@ def tick_values(self, vmin, vmax):
|
1679 | 1674 | return ticks
|
1680 | 1675 |
|
1681 | 1676 | 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 |
1686 | 1678 | return 1. / MUSECONDS_PER_DAY
|
1687 | 1679 |
|
1688 | 1680 | def _get_interval(self):
|
1689 |
| - """ |
1690 |
| - Return the number of units for each tick. |
1691 |
| - """ |
| 1681 | + # docstring inherited |
1692 | 1682 | return self._interval
|
1693 | 1683 |
|
1694 | 1684 |
|
|
0 commit comments