在python中,我正在使用matplotlib.figure和来自panda数据帧的多个数据来绘制多条线,我想清除在函数中绘制的其中一条线。但我没有找到任何办法。下面的代码显示了对我的问题的更好理解。
fig = Figure()
ax = fig.add_subplot(111)
LINE1 = df.plot(x='Time',y='LINE1',ax=ax) #ADD LINE1
LINE2 = df.plot(x='Time',y='LINE2',ax=ax) #ADD LINE2
LINE3 = df.plot(x='Time',y='LINE3',ax=ax) #ADD LINE3
canvas = FigureCanvasTkAgg(fig, master=root)
canvas.draw()
# Now I want to remove or clear or invisible LINE2 but I don't know how ?