Skip to content

Commit 5e74fb4

Browse files
authored
Merge pull request matplotlib#16906 from terencehonles/update-faq
update FAQ on how to register pandas converters
2 parents ff365ec + a6b42cb commit 5e74fb4

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

doc/faq/howto_faq.rst

+5-13
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,12 @@ Plot `numpy.datetime64` values
2121
As of Matplotlib 2.2, `numpy.datetime64` objects are handled the same way
2222
as `datetime.datetime` objects.
2323

24-
If you prefer the pandas converters and locators, you can register their
25-
converter with the `matplotlib.units` module::
26-
27-
from pandas.tseries import converter as pdtc
28-
pdtc.register()
29-
30-
If you only want to use the `pandas` converter for `numpy.datetime64` values ::
31-
32-
from pandas.tseries import converter as pdtc
33-
import matplotlib.units as munits
34-
import numpy as np
35-
36-
munits.registry[np.datetime64] = pdtc.DatetimeConverter()
24+
If you prefer the pandas converters and locators, you can register them. This
25+
is done automatically when calling a pandas plot function and may be
26+
unnecessary when using pandas instead of Matplotlib directly. ::
3727

28+
from pandas.plotting import register_matplotlib_converters
29+
register_matplotlib_converters()
3830

3931

4032
.. _howto-figure-empty:

0 commit comments

Comments
 (0)