Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. from plotly.graph_objs import graph_objs as go
  2.  
  3. # For Running Plotly plot locally on your notebooks
  4. from plotly.offline import init_notebook_mode, iplot
  5. init_notebook_mode(connected=True)
  6.  
  7. # Created Scatter object for both data-series
  8. trace0 = go.Scatter(
  9. x = df.index,
  10. y = df['aapl'],
  11. name="Apple"
  12. )
  13. trace1 = go.Scatter(
  14. x=df.index,
  15. y=df['ibm'],
  16. name="IBM"
  17. )
  18.  
  19. # Defining Layout
  20. layout = go.Layout(
  21. title=go.layout.Title(
  22. text='Stock Prive Variation over Time'
  23. ),
  24. xaxis=go.layout.XAxis(
  25. title=go.layout.xaxis.Title(
  26. text='Month'
  27. )
  28. ),
  29. yaxis=go.layout.YAxis(
  30. title=go.layout.yaxis.Title(
  31. text='Stock Prices'
  32. )
  33. )
  34. )
  35.  
  36. trace = [trace0,trace1]
  37.  
  38. iplot(go.Figure(data=trace, layout=layout))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement