diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index d001fe450e8d..e6af7a5fe74e 100755 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -629,13 +629,13 @@ class AutoDateFormatter(ticker.Formatter): format string. The default looks like this:: self.scaled = { - 365.0 : '%Y', - 30. : '%b %Y', - 1.0 : '%b %d %Y', - 1./24. : '%H:%M:%S', - 1. / (24. * 60.): '%H:%M:%S.%f', - } - + DAYS_PER_YEAR : '%Y', + DAYS_PER_MONTH : '%b %Y', + 1.0 : '%b %d %Y', + 1. / HOURS_PER_DAY : '%H:%M', + 1. / SEC_PER_DAY : '%H:%M:%S', + 1. / MUSECONDS_PER_DAY : '%H:%M:%S.%f' + } The algorithm picks the key in the dictionary that is >= the current scale and uses that format string. You can customize this @@ -688,8 +688,9 @@ def __init__(self, locator, tz=None, defaultfmt='%Y-%m-%d'): self.scaled = {DAYS_PER_YEAR: '%Y', DAYS_PER_MONTH: '%b %Y', 1.0: '%b %d %Y', - 1. / HOURS_PER_DAY: '%H:%M:%S', - 1. / (MINUTES_PER_DAY): '%H:%M:%S.%f'} + 1. / HOURS_PER_DAY: '%H:%M', + 1. / SEC_PER_DAY: '%H:%M:%S', + 1. / MUSECONDS_PER_DAY: '%H:%M:%S.%f'} def __call__(self, x, pos=None): locator_unit_scale = float(self._locator._get_unit()) 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