0
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?

OriolAbril
  • 7,315
  • 4
  • 29
  • 40
  • "remove this plot from the last". Can explain a bit more clearly? It's not clear what exactly you want – DavidG Apr 19 '18 at 14:01
  • You should also provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve), to make sure we will solve your problem, and not something else. – OriolAbril Apr 19 '18 at 16:24
  • Take a look here, [when to use cla(), clf() or close()](https://stackoverflow.com/questions/8213522/when-to-use-cla-clf-or-close-for-clearing-a-plot-in-matplotlib). – Tobias Wilfert Apr 19 '18 at 17:39

0 Answers0