Skip to content

Instantly share code, notes, and snippets.

@tanvirstreame
Created September 17, 2019 12:27
Show Gist options
  • Save tanvirstreame/f6c934a2a15df6dc3720bb384255e1c4 to your computer and use it in GitHub Desktop.
Save tanvirstreame/f6c934a2a15df6dc3720bb384255e1c4 to your computer and use it in GitHub Desktop.
line graph
import plotly.graph_objects as go
import datetime
x = [datetime.datetime(year=2013, month=10, day=4),
datetime.datetime(year=2013, month=11, day=5),
datetime.datetime(year=2013, month=12, day=6)]
fig = go.Figure(data=[go.Scatter(x=x, y=[1, 3, 6])])
# Use datetime objects to set xaxis range
fig.update_layout(xaxis_range=[datetime.datetime(2013, 10, 17),
datetime.datetime(2013, 11, 20)])
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment