Join GitHub today
Deprecate automatically registering matplotlib units (partial revert of 0.21.0) #18301
Given the feedback we have got (#18153, #18192, #18212, #18283, matplotlib/matplotlib#9577, matplotlib/matplotlib#9610, matplotlib/matplotlib#9771, pydata/xarray#166), it seems we underestimated the impact and we should consider (partly) reverting this change to properly deprecate it instead.
Depending on how we can do this, this might have the consequence that have to undo temporarily the lazy import of matplotlib (affecting the import time). See also discussion in #18283
Opening this issue to keep track of it, should be decided/done for 0.21.1
This was referenced
Nov 15, 2017
And then doing the registering manually will overwrite the deprecated units as a way to avoid the warning? And also using pandas plotting functionality the first time will do the same?
Side question: now we recommend people to do
Here's the behavior:
In : import pandas as pd imp In : import matplotlib.pyplot as plt In : fig, ax = plt.subplots() In : s = pd.Series(range(12), index=pd.date_range('2017', periods=12)) ...: In : ax.plot(s) /Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas/pandas/plotting/_converter.py:77: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters. To register the converters: >>> from pandas.tseries import converter >>> converter.register() warnings.warn(msg, FutureWarning) Out: [<matplotlib.lines.Line2D at 0x10e18eb38>]
In : import pandas as pd In : import matplotlib.pyplot as plt In : from pandas.tseries import converter In : converter.register() In : fig, ax = plt.subplots() In : s = pd.Series(range(12), index=pd.date_range('2017', periods=12)) In : ax.plot(s) Out: [<matplotlib.lines.Line2D at 0x1097c76d8>]
(the implementation isn't the prettiest, but it works).
Happy to move the recommended import location (while keeping