马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
想要在一个图里画多个折线图,分开是ok的,画在同一张图里就出现了混线
plt.figure()
for i in set(df['Indcd']):
print(i)
data = df[df['Indcd'].isin([i])]
data = data.drop_duplicates(subset='Trdmnt')
plt.plot(data['Trdmnt'], data['Weight'])
plt.figure()
d1 = df[df['Indcd'].isin([1])]
d1 = d1.drop_duplicates(subset='Trdmnt')
plt.plot(d1['Trdmnt'], d1['Weight'])
plt.figure()
d2 = df[df['Indcd'].isin([2])]
d2 = d2.drop_duplicates(subset='Trdmnt')
plt.plot(d2['Trdmnt'], d2['Weight'])
plt.figure()
data = df[df['Indcd'].isin([3])]
data = data.drop_duplicates(subset='Trdmnt')
plt.plot(data['Trdmnt'], data['Weight'])
plt.figure()
data = df[df['Indcd'].isin([4])]
data = data.drop_duplicates(subset='Trdmnt')
plt.plot(data['Trdmnt'], data['Weight'])
plt.figure()
data = df[df['Indcd'].isin([5])]
data = data.drop_duplicates(subset='Trdmnt')
plt.plot(data['Trdmnt'], data['Weight'])
|