我如何修改海底世界中的图例?

时间:2020-04-15 15:05:41

标签: python matplotlib seaborn

我已使用以下代码绘制了海洋的多条线图:

#Determing rolling statistics
rolmean = data.rolling(window=12).mean()
rolstd = data.rolling(window=12).std()

#Plot rolling statistics:
fig, ax = plt.subplots(figsize = (10,6))

ax.set_title('Rolling statistics for checking stationarity')

l1 = sb.lineplot(data = data, ax = ax)
l2 = sb.lineplot(data = rolmean, ax = ax, palette = ['red'])
l3 = sb.lineplot(data = rolstd, ax = ax, palette = ['black'])

但是,图例对所有3个图都有相同的标签。第一个情节(原始图)是熊猫系列对象。我想将图例修改为[原始,rollmean,rollstd]。请帮忙

enter image description here

0 个答案:

没有答案