def bounding_box_naive_handler(event): box = BoundingBox(convex_hull) plot_data.clean_plot(which='lines') box.append(box[0]) ax.plot(*zip(*box)) fig.canvas.draw() fig.canvas.flush_events()