Plotted using Autoplotter in jupyter where hours are in countsplot of Timestamp Vs Temp
I have a csv file, that contains a column called hours. While plotting that in x axis for line graph in plotly , it is getting represented in the form of counts like
0K, 50K,………..250K. The frequency seems to be 1
Is there any way to adjust the ticks according to timestamp?
Thanks in advance..
import plotly.graph_objects as go
import pandas as pd
import numpy as np
import plotly.express as px
df = pd.DataFrame(
{
"hours": range(1, 250 * 10 ** 3 + 1, 100),
"value": np.linspace(1, 10, 2500) * np.random.uniform(0.9, 1.1, 2500),
}
)
px.line(df, x="hours", y="value").update_traces(name="raw", showlegend=True).add_trace(
go.Scattergl(
x=(df["hours"] * 60 * 60 * 10 ** 9).astype("datetime64[ns]"),
y=df["value"] + 2,
name="epoch",
xaxis="x2",
)
).update_layout(xaxis2={"anchor": "y", "domain": [0.0, 1.0], "side": "top"})