if event.key == 'A':
xMax = 1500
length = len(recent_input_list)
if length == 0:
x = [[0, 752, 1500], [248, 1251]]
y = [[0, 1501, 0], [496, 495]]
kern = kern_list[0] + xMax + 300
kern_list.insert(0, kern)
else:
kern = kern_list[0]
print(kern)
x = [[kern+0, kern+752, kern+1500], [kern+248, kern+1251]]
y = [[0, 1501, 0], [496, 495]]
kern = kern_list[0] + xMax + 300
kern_list.insert(0, kern)
recent_input_list.insert(length, event.key)
delete_list.insert(length, event.key)
n = len(x)
for i in range(n):
line, = ax.plot(x[i], y[i], color='black', linewidth=2, linestyle=':')
print("Line is : ", line)
fig.canvas.draw()
with this code i am able to plot 'A','B','C' and so on.... but now i want to remove this plot from the last, how can i do that?