From 5fafcb99acb163dacf3da9c22f6cb0a564d52f01 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 18 Jun 2020 00:41:29 +0200 Subject: [PATCH] Clarify docs of AutoDateLocator.intervald --- lib/matplotlib/dates.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index ac0b33bc13c8..05d30f38fc70 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -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 default looks like this:: + Mapping of tick frequencies to multiples allowed for that ticking. + The default is :: 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], @@ -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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy