Skip to content

Instantly share code, notes, and snippets.

@karanjagota
Created June 10, 2019 16:37
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 karanjagota/c667a0291ddefe83431a374eb6b10e88 to your computer and use it in GitHub Desktop.
Save karanjagota/c667a0291ddefe83431a374eb6b10e88 to your computer and use it in GitHub Desktop.
gist for my medium blogs
np.random.seed(52)
fixedd_x1 = [x for x in range(1,21)]
random_y1 = np.random.randint(1,100,20)
random_y2 = np.random.randint(1,100,20)
random_y3 = np.random.randint(1,100,20)
trace0 = go.Scatter(x=fixedd_x1,y=random_y1,mode='lines')
trace1 = go.Scatter(x=fixedd_x1,y=random_y2,mode='markers')
trace2 = go.Scatter(x=fixedd_x1,y=random_y3,mode='lines+markers')
layout= go.Layout(title='Line Graph',
xaxis=dict(title='X-Axis'),
yaxis=dict(title='Y-Axis'))
data = [trace0,trace1,trace2]
fig = go.Figure(data=data,layout=layout)
pyo.plot(fig, filename = 'line.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment