繁体   English   中英

如何使用Plotly显示图表(线性)?

[英]How to show the charts(linear) using Plotly?

我在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-PC中启动了ipython-notebook ,但是我无法看到创建的图像或绘制的图表。 当我取消注释iplot语句时,输出如下所示: 并返回引发异常。PlotlyError(return_data ['error'])KeyError:'错误 如何绘制使用图并如何查看?

我的第一个想法是,您并未要求以下列方式在笔记本电脑模式下工作:

init_notebook_mode()

您导入了它,但从未运行过。

来自: https : //plot.ly/python/offline/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM