我在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:'错误。 如何绘制使用图以及如何查看?在
我的第一个想法是你没有告诉我在笔记本电脑模式下工作:
您导入了它,但从未运行过。在
发件人:https://plot.ly/python/offline/
相关问题 更多 >
编程相关推荐