# visual_plotly **Repository Path**: NFUNM018/visual_plotly ## Basic Information - **Project Name**: visual_plotly - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README import plotly as py import plotly.graph_objs as go 美国 = go.Scatter( x=[pd.to_datetime('01/01/{y}'.format(y=x), format="%m/%d/%Y") for x in dfe.columns.values], y=dfe.loc["美国",:].values, name = "美国" ) 欧盟28国 = go.Scatter( x=[pd.to_datetime('01/01/{y}'.format(y=x), format="%m/%d/%Y") for x in dfe.columns.values], y=dfe.loc["欧盟28国",:].values, name = "欧盟28国" ) layout = dict(xaxis=dict(rangeselector=dict( buttons=list([ dict(count=3, label="3年", step="year", stepmode="backward"), dict(count=5, label="5年", step="year", stepmode="backward"), dict(count=10, label="10年", step="year", stepmode="backward"), dict(count=20, label="20年", step="year", stepmode="backward"), dict(step="all") ])), rangeslider=dict(bgcolor="#70EC57"), title='年份' ), yaxis=dict(title='碳排放量'), title="碳排放量对比" ) fig = dict(data=[美国,欧盟28国], layout=layout) py.offline.plot(fig, filename = "输出中文_含时间序列的滑块选择器.html")