2016-12-28 58 views
1

我想在Juypter笔记本(在Kaggle中)绘制一个情节图,并且代码运行,但不渲染图像。使用Plotly版本1.12.12和Python 3.5。输出单元似乎只是隐藏起来。代码简单的图形低于:Plotly在Juypter笔记本上Kaggle

# 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

仍然没有能够解决这个问题。有什么建议?

谢谢你

回答

0

你的代码看起来像确定,在这里你是你的代码结果。

enter image description here

首先必须安装plotly?

pip install plotly 

第二次尝试是这样的;

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

RenS,你使用哪个版本的情节?我认为1.12.12的更新是导致我的问题的原因。 –

+0

我正在使用1.12.12 – Axis

0

此问题的解决方案是图表不会出现,直到点击Kaggle上的发布按钮。与Matplotlib不同,在发布之前,您无法查看绘图图表。