File tree Expand file tree Collapse file tree
doc/api/next_api_changes/deprecations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ``date_ticker_factory `` deprecated
2+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+ The ``date_ticker_factory `` method in the `matplotlib.dates ` module is
5+ deprecated. Instead use `~.AutoDateLocator ` and `~.AutoDateFormatter ` for a
6+ more flexible and scalable locator and formatter.
7+
8+ If you need the exact ``date_ticker_factory `` behavior, please copy the code.
Original file line number Diff line number Diff line change @@ -1782,6 +1782,8 @@ def num2epoch(d):
17821782 return np .asarray (d ) * SEC_PER_DAY - dt
17831783
17841784
1785+ @_api .deprecated ("3.6" , alternative = "`AutoDateLocator` and `AutoDateFormatter`"
1786+ " or vendor the code" )
17851787def date_ticker_factory (span , tz = None , numticks = 5 ):
17861788 """
17871789 Create a date locator with *numticks* (approx) and a date formatter
Original file line number Diff line number Diff line change @@ -1319,8 +1319,9 @@ def test_concise_formatter_call():
13191319 (200 , mdates .MonthLocator ),
13201320 (2000 , mdates .YearLocator )))
13211321def test_date_ticker_factory (span , expected_locator ):
1322- locator , _ = mdates .date_ticker_factory (span )
1323- assert isinstance (locator , expected_locator )
1322+ with pytest .warns (_api .MatplotlibDeprecationWarning ):
1323+ locator , _ = mdates .date_ticker_factory (span )
1324+ assert isinstance (locator , expected_locator )
13241325
13251326
13261327def test_usetex_newline ():
You can’t perform that action at this time.
0 commit comments