Skip to content

Commit 2915f1f

Browse files
committed
Add rrulewrapper to docs
1 parent 3699ff3 commit 2915f1f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/matplotlib/dates.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@
142142
143143
* `YearLocator`: Locate years that are multiples of base.
144144
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`
147147
which allow almost arbitrary date tick specifications.
148148
See :doc:`rrule example </gallery/ticks/date_demo_rrule>`.
149149
@@ -195,7 +195,7 @@
195195
'rrule', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
196196
'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY',
197197
'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta',
198-
'DateConverter', 'ConciseDateConverter')
198+
'DateConverter', 'ConciseDateConverter', 'rrulewrapper')
199199

200200

201201
_log = logging.getLogger(__name__)
@@ -981,16 +981,27 @@ def __call__(self, x, pos=None):
981981

982982
class rrulewrapper:
983983
"""
984-
A simple wrapper around a ``dateutil.rrule`` allowing flexible
984+
A simple wrapper around a `dateutil.rrule` allowing flexible
985985
date tick specifications.
986986
"""
987987
def __init__(self, freq, tzinfo=None, **kwargs):
988+
"""
989+
Parameters
990+
----------
991+
freq : {YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY}
992+
Tick frequency.
993+
tzinfo : `datetime.tzinfo`, optional
994+
Time zone information. The default is None.
995+
**kwargs
996+
Additional keyword arguments passed to the `rrule`.
997+
"""
988998
kwargs['freq'] = freq
989999
self._base_tzinfo = tzinfo
9901000

9911001
self._update_rrule(**kwargs)
9921002

9931003
def set(self, **kwargs):
1004+
"""Set parameters for an existing wrapper."""
9941005
self._construct.update(kwargs)
9951006

9961007
self._update_rrule(**self._construct)

0 commit comments

Comments
 (0)