Add flat-field_pointer.py
https://matplotlib.org/3.8.4/gallery/event_handling/coords_demo.html
This commit is contained in:
parent
1e8d9d844c
commit
981e2a48ae
19
datasets/raise/flat-field_pointer.py
Normal file
19
datasets/raise/flat-field_pointer.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user