Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
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
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