|
142 | 142 |
|
143 | 143 | * `YearLocator`: Locate years that are multiples of base.
|
144 | 144 |
|
145 |
| -* `RRuleLocator`: Locate using a ``matplotlib.dates.rrulewrapper``. |
146 |
| - ``rrulewrapper`` is a simple wrapper around dateutil_'s `dateutil.rrule` |
| 145 | +* `RRuleLocator`: Locate using a `rrulewrapper`. |
| 146 | + `rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule` |
147 | 147 | which allow almost arbitrary date tick specifications.
|
148 | 148 | See :doc:`rrule example </gallery/ticks/date_demo_rrule>`.
|
149 | 149 |
|
|
195 | 195 | 'rrule', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
|
196 | 196 | 'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY',
|
197 | 197 | 'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta',
|
198 |
| - 'DateConverter', 'ConciseDateConverter') |
| 198 | + 'DateConverter', 'ConciseDateConverter', 'rrulewrapper') |
199 | 199 |
|
200 | 200 |
|
201 | 201 | _log = logging.getLogger(__name__)
|
@@ -981,16 +981,28 @@ def __call__(self, x, pos=None):
|
981 | 981 |
|
982 | 982 | class rrulewrapper:
|
983 | 983 | """
|
984 |
| - A simple wrapper around a ``dateutil.rrule`` allowing flexible |
| 984 | + A simple wrapper around a `dateutil.rrule` allowing flexible |
985 | 985 | date tick specifications.
|
986 | 986 | """
|
987 | 987 | def __init__(self, freq, tzinfo=None, **kwargs):
|
| 988 | + """ |
| 989 | + Parameters |
| 990 | + ---------- |
| 991 | + freq : {YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY} |
| 992 | + Tick frequency. These constants are defined in `dateutil.rrule`, |
| 993 | + but they are accessible from `matplotlib.dates` as well. |
| 994 | + tzinfo : `datetime.tzinfo`, optional |
| 995 | + Time zone information. The default is None. |
| 996 | + **kwargs |
| 997 | + Additional keyword arguments are passed to the `dateutil.rrule`. |
| 998 | + """ |
988 | 999 | kwargs['freq'] = freq
|
989 | 1000 | self._base_tzinfo = tzinfo
|
990 | 1001 |
|
991 | 1002 | self._update_rrule(**kwargs)
|
992 | 1003 |
|
993 | 1004 | def set(self, **kwargs):
|
| 1005 | + """Set parameters for an existing wrapper.""" |
994 | 1006 | self._construct.update(kwargs)
|
995 | 1007 |
|
996 | 1008 | self._update_rrule(**self._construct)
|
|
0 commit comments