如何用绘图法显示图表(线性)?

2024-03-29 07:37:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我在python中使用以下脚本:

from plotly.offline import init_notebook_mode, iplot
import plotly.plotly as py
from plotly.graph_objs import *
from plotly.plotly.plotly import image
X=[1,2,3]
Y=[1,2,3]
fig = {'data': [{'x': X, 'y': Y, 'type': 'bar'}]}
#iplot([{"x": X, "y": Y}])
image.ishow(fig, 'png', scale=3)

我也在ubuntu个人电脑上启动了ipython笔记本电脑,但我无法看到创建的图像或绘制的图表。 当我取消iplot语句的注释时,输出如下所示: 它返回提高异常.PlotlyError(return_data['error']) KeyError:'错误。 如何绘制使用图以及如何查看?在


Tags: frompyimageimport脚本datainitmode