Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Backport PR #17664 on branch v3.3.x (Clarify docs of AutoDateLocator.intervald)#17677

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletionslib/matplotlib/dates.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1215,14 +1215,14 @@ class AutoDateLocator(DateLocator):
----------
intervald : dict

Mapping of tick frequencies(a constant from dateutil.rrule) to
multiples allowed for that ticking.The defaultlooks like this::
Mapping of tick frequenciesto multiples allowed for that ticking.
The defaultis::

self.intervald = {
YEARLY : [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
1000, 2000, 4000, 5000, 10000],
MONTHLY : [1, 2, 3, 4, 6],
DAILY : [1, 2, 3, 7, 14],
DAILY : [1, 2, 3, 7, 14, 21],
HOURLY : [1, 2, 3, 4, 6, 12],
MINUTELY: [1, 5, 10, 15, 30],
SECONDLY: [1, 5, 10, 15, 30],
Expand All@@ -1231,10 +1231,16 @@ class AutoDateLocator(DateLocator):
100000, 200000, 500000, 1000000],
}

where the keys are defined in `dateutil.rrule`.

The interval is used to specify multiples that are appropriate for
the frequency of ticking. For instance, every 7 days is sensible
for daily ticks, but for minutes/seconds, 15 or 30 make sense.
You can customize this dictionary by doing::

When customizing, you should only modify the values for the existing
keys. You should not add or delete entries.

Example for forcing ticks every 3 hours::

locator = AutoDateLocator()
locator.intervald[HOURLY] = [3] # only show every 3 hours
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp