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

DOC: add FAQ about np.datetime64#5625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
efiring merged 1 commit intomatplotlib:masterfromtacaswell:faq_datetime64
Feb 14, 2016
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletionsdoc/faq/howto_faq.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,6 +14,35 @@ How-To
Plotting: howto
===============

.. _howto-datetime64:

Plot `numpy.datetime64` values
------------------------------

For matplotlib to plot dates (or any scalar with units) a converter
to float needs to be registered with the `matplolib.units` module. The
current best converters for `datetime64` values are in `pandas`. Simply
importing `pandas` ::

import pandas as pd

should be sufficient as `pandas` will try to install the converters
on import. If that does not work, or you need to reset `munits.registry`
you can explicitly install the `pandas` converters by ::

from pandas.tseries import converter as pdtc
pdtc.register()

If you only want to use the `pandas` converter for `datetime64` values ::

from pandas.tseries import converter as pdtc
import matplotlib.units as munits
import numpy as np

munits.registry[np.datetime64] = pdtc.DatetimeConverter()



.. _howto-findobj:

Find all objects in a figure of a certain type
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp