From 0104905110cbb8c08e77d5c7372f66b2086ae60f Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Sat, 26 Mar 2016 15:35:50 +0100 Subject: [PATCH] Add a locator to AutoDateFormatters example code AutoDateFormatter.__init__ always needs a locator, so add one to the example in the documentation. --- lib/matplotlib/dates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index fbd0bf480cda..d2b24e43d6c1 100755 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -642,7 +642,8 @@ class AutoDateFormatter(ticker.Formatter): dictionary by doing:: - >>> formatter = AutoDateFormatter() + >>> locator = AutoDateLocator() + >>> formatter = AutoDateFormatter(locator) >>> formatter.scaled[1/(24.*60.)] = '%M:%S' # only show min and sec A custom :class:`~matplotlib.ticker.FuncFormatter` can also be used.