使用 Plotly 从列表中绘制点图
Dot plot from list with Plotly
我有一辆 Pandas Serie S,
Index Number
A 10
B 13
C 14
D 23
我的目标是用 python 绘制此列表的点图。
我正在关注这个教程:with plotly
但是,我不明白如何从 serie 到 viz。
我尝试了以下方法:
fig = px.scatter(s, x="number", y="index",
title="Title")
fig.show()
但是没有任何反应。
我去plotly dot plot的过程有什么问题?
与教程类似,您可以将数据保存在数据框中并绘制出来
from bokeh.io import output_notebook
output_notebook()
import pandas as pd
import plotly.express as px
S = pd.Series([10, 13, 14, 23], index=['A','B','C','D'])
df = pd.DataFrame({'index' : S.index,
'values': S.values})
fig = px.scatter(df, x="index", y="values")
fig.show()
我有一辆 Pandas Serie S,
Index Number
A 10
B 13
C 14
D 23
我的目标是用 python 绘制此列表的点图。
我正在关注这个教程:with plotly
但是,我不明白如何从 serie 到 viz。
我尝试了以下方法:
fig = px.scatter(s, x="number", y="index",
title="Title")
fig.show()
但是没有任何反应。
我去plotly dot plot的过程有什么问题?
与教程类似,您可以将数据保存在数据框中并绘制出来
from bokeh.io import output_notebook
output_notebook()
import pandas as pd
import plotly.express as px
S = pd.Series([10, 13, 14, 23], index=['A','B','C','D'])
df = pd.DataFrame({'index' : S.index,
'values': S.values})
fig = px.scatter(df, x="index", y="values")
fig.show()