[英]Why doesn't the plot generated by Plotly in a Jupyter Notebook display after I upload it on Github?
I plotted a figure in Jupyter Notebook using Plotly , and it displayed all right locally.我使用Plotly在 Jupyter Notebook 中绘制了一个图形,它在本地显示正常。 However, nothing showed up below the code chunk after I upload the Jupyter Notebook to one of my repositories on Github .但是,在我将Jupyter Notebook上传到Github上的一个存储库后,代码块下方没有显示任何内容。 Is this just the way it is, or did I miss something?就是这样,还是我错过了什么? How can I make the figure seen?我怎样才能看到这个数字?
import plotly.graph_objs as go
data = list()
COLORS = ["aqua","sienna","coral","darkgreen","darksalmon",
"darkslateblue","greenyellow","maroon","violet"]
for county, col in zip(COUNTIES,COLORS):
trace = go.Scatter(x = DF.columns,
y = DF.loc[county,:],
name = county,
line = dict(color = col),
opacity = 0.8)
data.append(trace)
fig = go.Figure(data = data,
layout = dict(title = "County-level (Normalized) Daily New Cases"))
fig.show()
If the image in the Jupyter Notebook is generated by running code, then GitHub won't render it.如果 Jupyter Notebook 中的图像是通过运行代码生成的,那么 GitHub 将不会渲染它。 GitHub doesn't execute code from users or permit user-provided JavaScript when rendering files, because doing so is a security risk. GitHub 在渲染文件时不会执行来自用户的代码或允许用户提供的 JavaScript,因为这样做存在安全风险。 User-provided code could be used to steal credentials, attack other servers, or otherwise do a wide variety of nefarious things.用户提供的代码可用于窃取凭据、攻击其他服务器或以其他方式进行各种邪恶的事情。
So the answer is that this is just the way it is.所以答案是,事情就是这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.