Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0104905

Browse files
committed
Add a locator to AutoDateFormatters example code
AutoDateFormatter.__init__ always needs a locator, so add one to the example in the documentation.
1 parent c06bb2b commit 0104905

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ class AutoDateFormatter(ticker.Formatter):
642642
dictionary by doing::
643643
644644
645-
>>> formatter = AutoDateFormatter()
645+
>>> locator = AutoDateLocator()
646+
>>> formatter = AutoDateFormatter(locator)
646647
>>> formatter.scaled[1/(24.*60.)] = '%M:%S' # only show min and sec
647648
648649
A custom :class:`~matplotlib.ticker.FuncFormatter` can also be used.

0 commit comments

Comments
 (0)