Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. data=[]
  2.  
  3. trace_names=['Subscriber', 'Customer']
  4.  
  5. for i in range(2):
  6. data.append(
  7. go.Histogram(
  8. x=trip[(trip.subscription_type==trace_names[i]) & (trip.duration_min<60)].duration_min,
  9. name=trace_names[i],
  10. marker=dict(
  11. color=chosen_colors[i]
  12. ),
  13. opacity=0.5
  14. )
  15. )
  16.  
  17. layout = go.Layout(
  18. title='Distribution of bike trip duration in Bay Area',
  19. barmode='overlay',
  20. xaxis=dict(
  21. title='Trip Duration (minutes)'
  22. ),
  23. yaxis=dict(
  24. title='Count'
  25. ),
  26. #hovermode='closest',
  27. #showlegend=True
  28. )
  29.  
  30. figure = go.Figure(data=data, layout=layout)
  31.  
  32. ply.iplot(figure)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement