From a6b42cb69060b06d4bf36a4bc6c32f77b7e6e5dd Mon Sep 17 00:00:00 2001 From: Terence Honles Date: Wed, 25 Mar 2020 10:30:39 -0700 Subject: [PATCH] update FAQ on how to register pandas converters `pandas.tseries.converter` no longer exists, and the individual converters are not part of the public API so this change updates the documentation to reflect how to properly register the pandas converters with matplotlib. --- doc/faq/howto_faq.rst | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/doc/faq/howto_faq.rst b/doc/faq/howto_faq.rst index 6ffa28963670..52dbe45b52ab 100644 --- a/doc/faq/howto_faq.rst +++ b/doc/faq/howto_faq.rst @@ -21,20 +21,12 @@ Plot `numpy.datetime64` values As of Matplotlib 2.2, `numpy.datetime64` objects are handled the same way as `datetime.datetime` objects. -If you prefer the pandas converters and locators, you can register their -converter with the `matplotlib.units` module:: - - from pandas.tseries import converter as pdtc - pdtc.register() - -If you only want to use the `pandas` converter for `numpy.datetime64` values :: - - from pandas.tseries import converter as pdtc - import matplotlib.units as munits - import numpy as np - - munits.registry[np.datetime64] = pdtc.DatetimeConverter() +If you prefer the pandas converters and locators, you can register them. This +is done automatically when calling a pandas plot function and may be +unnecessary when using pandas instead of Matplotlib directly. :: + from pandas.plotting import register_matplotlib_converters + register_matplotlib_converters() .. _howto-figure-empty: