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

[Bug]: Plotting of Pandas DataFrame data with nanosecond timestamps #23493

Open
@wolfig

Description

@wolfig

Bug summary

When plotting time-series data from a high-frequency data source, the plot looks distorted when the values are plotted against a nanosecond timestamp.

I am working in PyCharm 2021.2.2 Community Edition, without Jupiter notebook

Code for reproduction

importpandasaspdfrompandasimportDataFramefrommatplotlibimportpyplotaspltif__name__=='__main__':data=DataFrame(pd.read_hdf('YRT1DT2F_rawdata_series_2022-05-10_0h-6h.h5','YRT1DT2F'))data=data[pd.to_datetime('2022-05-10 04:28:32.573995',utc=False,unit='ns'):pd.to_datetime('2022-05-10 04:28:32.574',utc=False,unit='ns')]print(data)plt.plot(data['value'])# produces bad outputplt.show()plt.plot(data['value'].values)# produces good outputplt.show()

Actual outcome

Plot result ofdata['values'].values
Bildschirmfoto 2022-07-26 um 15 47 09

Plot result ofdata['values']
Bildschirmfoto 2022-07-26 um 15 47 40

Expected outcome

I would expect the plot result to lookalike "good plot", but with time-scaled x-Axis

Additional information

No response

Operating system

MacOS 12.4 (Monterey)

Matplotlib Version

3.5.2

Matplotlib Backend

MacOSX

Python version

3.9.13

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp