Преобразование matplot в сюжет - PullRequest
1 голос
/ 02 июля 2019

Я хотел бы знать, возможно ли импортировать имя index из matplot в сюжет, как я пытался ниже:

Бар Matplot:

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)

enter image description here

Конвертированная панель 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)

enter image description here

1 Ответ

0 голосов
/ 02 июля 2019

Попробуйте это,

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')
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...