import plotly.express as px
import pandas as pd
df = ...
# you can generate an interactive line plot using Plotly Express
fig = px.line(df, x=df.index, y=df.columns)
fig.update_layout(
title='Rank Over Time',
xaxis_title='Time',
yaxis_title='Rank',
hovermode='closest' # this will enable data tracing when you hover over the plot
)
fig.show()
1条答案
按热度按时间nimxete21#
您可以在Jupyter Notebook中使用交互式绘图库
Plotly
。字符串
px.line()
将创建一个交互式线图,它将数据框作为输入,x值是数据框索引,y值是数据框的所有列。