1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| import plotly.graph_objects as go
years = [1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012]
fig = go.Figure() fig.add_trace(go.Bar(x=years, y=[219, 146, 112, 127, 124, 180, 236, 207, 236, 263, 350, 430, 474, 526, 488, 537, 500, 439], name='Rest of world', marker_color='rgb(55, 83, 109)' )) fig.add_trace(go.Bar(x=years, y=[16, 13, 10, 11, 28, 37, 43, 55, 56, 88, 105, 156, 270, 299, 340, 403, 549, 499], name='China', marker_color='rgb(26, 118, 255)' ))
fig.update_layout( title='US Export of Plastic Scrap', xaxis_tickfont_size=14, yaxis=dict( title='USD (millions)', titlefont_size=16, tickfont_size=14, ), legend=dict( x=0, y=1.0, bgcolor='rgba(255, 255, 255, 0)', bordercolor='rgba(255, 255, 255, 0)' ), barmode='group', bargap=0.15, bargroupgap=0.1 ) fig.show()
|