【发布时间】:2022-08-02 23:14:47
【问题描述】:
我一直在尝试在 google colab 上显示直方图,但没有显示。
下面是不显示的代码
//imports
from chart_studio import plotly
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
import plotly.graph_objs as go
// code starts from here
trace = go.Histogram(
x = data.defects,
opacity = 0.75,
name = \"Defects\",
marker = dict(color = \'green\'))
hist_data = [trace]
hist_layout = go.Layout(barmode=\'overlay\',
title = \'Defects\',
xaxis = dict(title = \'True - False\'),
yaxis = dict(title = \'Frequency\'),
)
fig = go.Figure(data = hist_data, layout = hist_layout)
iplot(fig) //This is not displaying anything
标签: python google-colaboratory