我正在尝试为以下绘图创建子图:
我用于绘图的代码是:
radius_mean1 = df[df['diagnosis']==1]['radius_mean']
radius_mean0 = df[df['diagnosis']==0]['radius_mean']
trace_rm1 = go.Histogram(x = radius_mean1, opacity = 0.75, name = 'malignant')
trace_rm2 = go.Histogram(x = radius_mean0, opacity = 0.75, name = 'benign')
data2 = [trace_rm1,trace_rm2]
layout2 = go.Layout(barmode = 'overlay', title = 'radius mean')
fig2 = go.Figure(data=data2, layout=layout2)
py.iplot(fig2)
另一个情节也差不多
现在,我使用找到的以下代码创建子批次:
^{pr2}$如何在子图中同时添加良性和恶性结果? 我似乎无法编辑[0]或[1]来显示这两个图,即在我的子图中有前2个图同时显示恶性和良性,而不是一个或另一个。在
这是一个简单的问题。我不知道为什么这里没有答案。。。虽然已经11个月了,但我在这里回答这个问题。在
这里的数据不完整,所以我用一些演示数据来展示。在
相关问题 更多 >
编程相关推荐