我有以下数据集:
month is_member not_member
0 April 84 7
1 August 292 85
2 July 353 125
3 June 260 35
4 May 238 42
5 November 74 6
6 October 219 29
7 September 288 36
我已经绘制了两个独立的图形,但找不到如何组合它们并在一个图形上显示两条线的指导
我知道这可能是一个基本的问题,但我会感谢你的帮助
import cufflinks as cf
from plotly.offline import download_plotlyjs, init_notebook_mode, plot,
iplot
init_notebook_mode(connected=True)
cf.go_offline()
%matplotlib inline
图1:
trace1 = MPVT.iplot(kind='line',x='month',y='not_member', color='white',
theme='solar', mode='markers+lines',title='bike demand by month for non-
members')
图2:
trace2 = MPVT.iplot(kind='line',x='month',y='is_member', color='gold',
theme = 'solar', mode='lines')
谢谢
以下代码应起作用:
导入库
创建示例数据帧
创建绘图
相关问题 更多 >
编程相关推荐