import plotly.express as px
import pandas as pd

# 创建示例数据
data = pd.DataFrame({
    'x': [1, 2, 3, 4, 5],
    'y': [5, 4, 3, 2, 1]
})

# 使用 plotly.express 绘制散点图
fig = px.scatter(data, x='x', y='y', title='Scatter plot')
fig.show()

结果:

[python][plotly]利用plotly绘制散点图_信息可视化