Skip to content

Instantly share code, notes, and snippets.

@fleutot
Created October 31, 2019 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fleutot/9ad9dc8acf940955c9a855364e94e5f8 to your computer and use it in GitHub Desktop.
Save fleutot/9ad9dc8acf940955c9a855364e94e5f8 to your computer and use it in GitHub Desktop.
Showing wrong time axis in older version of Plotly (3.7.1)
#!/usr/bin/env python3
import plotly.graph_objs as go
from plotly.offline import plot
import datetime as dt
data = [
go.Scatter(
x = [
dt.datetime.strptime("2019-10-31T12:00:00", "%Y-%m-%dT%H:%M:%S"),
dt.datetime.strptime("2019-10-31T13:00:00", "%Y-%m-%dT%H:%M:%S")
],
y = [ 10, 20 ]
)]
fig = go.Figure(data)
plot(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment