File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
doc/api/next_api_changes/deprecations Expand file tree Collapse file tree 3 files changed +13
-2
lines changed 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):
1782
1782
return np .asarray (d ) * SEC_PER_DAY - dt
1783
1783
1784
1784
1785
+ @_api .deprecated ("3.6" , alternative = "`AutoDateLocator` and `AutoDateFormatter`"
1786
+ " or vendor the code" )
1785
1787
def date_ticker_factory (span , tz = None , numticks = 5 ):
1786
1788
"""
1787
1789
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():
1319
1319
(200 , mdates .MonthLocator ),
1320
1320
(2000 , mdates .YearLocator )))
1321
1321
def 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 )
1324
1325
1325
1326
1326
1327
def test_usetex_newline ():
You can’t perform that action at this time.
0 commit comments