Timeseries plot with timedelta axis

Hello,

Is there anyway to show timedelta data in β€˜%H:%M:%S’ format on the plot? Below is my simple code. I want the x axis ticks to be in %M:%S format.

Thanks

import pandas as pd
import plotly.graph_objs as go

from plotly.offline import init_notebook_mode
from plotly.offline import iplot 
init_notebook_mode(connected=True)

df = pd.DataFrame({'x': range(1000), 'y':np.sin(np.arange(1000)/100)})
df.x = pd.to_timedelta(df.x, unit='s')
trace = go.Scatter(x=df.x, y=df.y)
data = [trace]
fig = go.Figure(data)
iplot(fig)

Hi @Shahab_ai,

No, this isn’t directly supported right now. See https://github.com/plotly/plotly.py/issues/799 and https://github.com/plotly/plotly.py/issues/801. Perhaps the workaround in https://github.com/plotly/plotly.py/issues/801#issuecomment-317174985 would be helpful.

-Jon

1 Like

Bummer! Basic python data type support would be great