密密麻麻地写在卡格电脑上

2024-04-27 06:10:01 发布

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

我试图在Juypter笔记本(在Kaggle上)中渲染一个绘图仪,代码运行,但不渲染图像。使用Plotly版本1.12.12和Python3.5。输出单元格似乎只是隐藏起来了。简单图形代码如下:

# Imports 
import plotly.plotly as py
import plotly.graph_objs as go
from plotly import tools
from plotly.offline import iplot, init_notebook_mode
init_notebook_mode(connected=True) 
# Graph
iplot([{"x": [1, 2, 3], "y": [3, 1, 6]}])

我在以下链接中找到了一些评论:

https://community.plot.ly/t/offline-mode-in-jupyter-notebook-shows-blank-graphs/1860/22

还是没能解决这个问题。有什么建议吗?在

谢谢你


Tags: from图像importinitmodeas笔记本plotly
2条回答

这个问题的解决方案是,在点击Kaggle上的publish按钮之前,图表不会出现。与Matplotlib不同,在发布之前不能查看绘图仪。在

你的代码看起来不错,这是你的代码结果。在

enter image description here

你先安装好了吗?在

pip install plotly

像这样第二次尝试

^{pr2}$

相关问题 更多 >