Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda544e0

Browse files
QuLogicmeeseeksmachine
authored andcommitted
Backport PRmatplotlib#16906: update FAQ on how to register pandas converters
1 parent9a2f057 commitda544e0

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

‎doc/faq/howto_faq.rst

Lines changed: 5 additions & 13 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp