Add flat-field_pointer.py

https://matplotlib.org/3.8.4/gallery/event_handling/coords_demo.html
This commit is contained in:
Benjamin Loison 2024-04-26 01:21:20 +02:00
parent 1e8d9d844c
commit 981e2a48ae
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -0,0 +1,19 @@
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backend_bases import MouseButton
import matplotlib.image as mpimg
import os
os.chdir('flat-field/TIF')
def onClick(event):
if event.button is MouseButton.LEFT:
print(event.x, event.y)
plt.close()
for fileName in os.listdir():
print(fileName)
image = mpimg.imread(fileName)
plt.imshow(image)
plt.connect('button_press_event', onClick)
plt.show(block = True)