Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. trace2 = go.Bar(
  2. x=temp_df1.city,
  3. y=temp_df1.id.cumsum().shift(1),
  4. #name='No. of stations',
  5. hoverinfo=None,
  6. marker=dict(
  7. color='rgba(1,1,1,0.0)'
  8. )
  9. )
  10. trace1 = go.Bar(
  11. x=temp_df1.city,
  12. y=temp_df1.id,
  13. name='No. of stations',
  14. text=temp_df1.id,
  15. textposition='outside',
  16. marker=dict(
  17. color=chosen_colors[0]
  18. )
  19. )
  20.  
  21.  
  22. data=[trace2, trace1]
  23.  
  24. layout = go.Layout(
  25. title='No. of bike stations in Bay Area cities',
  26. xaxis=dict(
  27. title='City'
  28. ),
  29. yaxis=dict(
  30. title='No. of bike stations'
  31. ),
  32. barmode='stack',
  33. hovermode='closest',
  34. showlegend=False
  35. )
  36.  
  37. figure = go.Figure(data=data, layout=layout)
  38.  
  39. ply.iplot(figure)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement