Python 将matplot转换为plotly

Python 将matplot转换为plotly,python,python-3.x,pandas,matplotlib,plotly,Python,Python 3.x,Pandas,Matplotlib,Plotly,我想知道是否可以将索引的名称从matplot导入plotly,正如我在下面尝试的那样: 图条: fig = plt.figure(figsize = (10, 5)) ax = fig.add_subplot(111) pd.Series([10, 20, 30, 40, 50], index =['a', 'b', 'c', 'd', 'e']).plot.bar(ax = ax) 已将Matplot栏转换为Plotly: fig = plt.figure(figsize = (10,

我想知道是否可以将索引的名称从matplot导入plotly,正如我在下面尝试的那样:

图条:

fig = plt.figure(figsize = (10, 5))
ax = fig.add_subplot(111)

pd.Series([10, 20, 30, 40, 50], index =['a', 'b', 'c', 'd', 'e']).plot.bar(ax = ax)

已将Matplot栏转换为Plotly:

fig = plt.figure(figsize = (10, 5))
ax = fig.add_subplot(111)

pd.Series([10, 20, 30, 40, 50], index =['a', 'b', 'c', 'd', 'e']).plot.bar(ax = ax)

py.iplot_mpl(fig)
试试这个

import plotly.plotly as py
import plotly.graph_objs as go

data = [go.Bar(
        x=['a', 'b', 'c', 'd', 'e'],
        y=[10, 20, 30, 40, 50]
)]

py.plot(data, filename='basic-bar')
试试这个

import plotly.plotly as py
import plotly.graph_objs as go

data = [go.Bar(
        x=['a', 'b', 'c', 'd', 'e'],
        y=[10, 20, 30, 40, 50]
)]

py.plot(data, filename='basic-bar')

您好,很抱歉造成混淆,但我想问的是,为什么每次matplot转换为plotly时都不导入索引,谢谢您的回答。这将完全创建一个plotly,它将显示indexHello,很抱歉造成混淆,但我想问的是,为什么每次matplot转换为plotly时都不导入索引,但感谢您的回答。这将完全创建一个显示索引的绘图