Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for WeekdayLocator.byweekday parameter incorrect? #2724

Closed
pybokeh opened this issue Jan 13, 2014 · 0 comments
Closed

Documentation for WeekdayLocator.byweekday parameter incorrect? #2724

pybokeh opened this issue Jan 13, 2014 · 0 comments
Assignees
Milestone

Comments

@pybokeh
Copy link

pybokeh commented Jan 13, 2014

Hello, per api doc examples:
http://matplotlib.org/api/dates_api.html

users are lead to believe that they can use just plainly use "MO" such as:
loc = WeekdayLocator(byweekday=MO)

But when I execute the code above, I get a 'MO' not defined error.

So I looked at the weekdaylocator api doc:
http://matplotlib.org/api/dates_api.html#matplotlib.dates.WeekdayLocator

It says the following about the byweekday parameter:
"Mark every weekday in byweekday; byweekday can be a number or sequence.

Elements of byweekday must be one of MO, TU, WE, TH, FR, SA, SU, the constants from dateutils.rrule."

After reading the above, I modified my code to be the following after importing dateutil:
loc = WeekdayLocator(byweekday=dateutil.rrule.MO)
or loc = WeekdayLocator(byweekday=0)

Now, my script executes ok. By the way, the doc says "dateutils.rrule", it should leave out the "s" and instead be "dateutil.rrule", so that is another fix that needs to be made in the documentation.

tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 13, 2014
 - added explicit import for day of week alias
 - fixed dateutils -> dateutil type

closes issue matplotlib#2724
@ghost ghost assigned tacaswell Jan 13, 2014
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 13, 2014
 - added explicit import for day of week alias
 - fixed dateutils -> dateutil type

closes issue matplotlib#2724
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Jan 13, 2014
 - added explicit import for day of week alias
 - fixed dateutils -> dateutil type

closes issue matplotlib#2724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants