I have a scatter plot, over an imshow (map). I want a click event to add a new scatter point, which I have done by scater(newx,newy)). The trouble is, I then want to add the ability to remove points using a pick event. As there is no remove(pickX,PickY) function, I must get the picked Index and remove them from the list, which means I can't create my scatter as above, I must scatter(allx, ally).
So the bottom line is I need a method of removing the scatter plot and redrawing it with new data, without changing the presence of my imshow. I have tried and tried: just one attempt.
fig = Figure()
axes = fig.add_subplot(111)
axes2 = fig.add_subplot(111)
axes.imshow(map)
axes2.scatter(allx,ally)
# and the redraw
fig.delaxes(axes2)
axes2 = fig.add_subplot(111)
axes2.scatter(NewscatterpointsX,NewscatterpointsY,picker=5)
canvas.draw()
much to my suprise, this dispensed with my imshow and axes too :(. Any methods of achieving my dream is much appreciated. Andrew