Iโm trying to plotly a series of values using plotly.express.scatter
, but there seems to be a strange binning phenomenon occurring in the resulting figure.
The hover values are correctly placed, but the markers are incorrectly placed.
When using px.line
however, the plot is displayed correctly.
Iโm currently using the latest version of plotly 5.19.0 (but the same issue was present for 5.9.0)
Can anybody explain whatโs happening here?
MWE:
import numpy as np
import pandas as pd
import plotly.express as px
timestamps = pd.date_range('2020-01-01T09:00', '2020-01-01T10:00', freq='s')
values = np.random.rand(len(timestamps))
df = pd.DataFrame({'t': timestamps, 'x': values})
px.scatter(df, x="t", y="x")
Resulting figure: