79562524

Date: 2025-04-08 15:54:10
Score: 4.5
Natty:
Report link

Thanks for this discussion, I am trying to the same for my application but I have to do this for several images sequentially, So I tried the same but in a for loop, for eg:

for i_ in range(2):
    fig, ax = plt.subplots()

    # ax.add_artist(ab)

    for row in range(1,30):
        tolerance = 30 # points
        ax.plot(np.arange(0,15,0.5),[i*row/i for i in range(1,15*2+1)], 'ro-', picker=tolerance, zorder=0)


    fig.canvas.callbacks.connect('pick_event', on_pick)
    klicker = clicker(ax, ["event"], markers=["x"], **{"linestyle": "--"})


    plt.draw()
    plt.savefig('add_picture_matplotlib_figure_{i_}.png',bbox_inches='tight')
    plt.show()

But i get the click functionality only for the last image. How can i get it done for all the images?




Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (0.5): How can i
  • Blacklisted phrase (1): I have to do
  • Blacklisted phrase (1): I am trying to
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Seena