-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatePlot.py
More file actions
31 lines (27 loc) · 878 Bytes
/
createPlot.py
File metadata and controls
31 lines (27 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from matplotlib import image, patches, pyplot as plt
from matplotlib.widgets import Button
decision ={}
def _yes(event):
if event.button == 1:
decision['dec'] = 1
plt.close()
def _no(event):
if event.button == 1:
decision['dec'] = 2
plt.close()
def _trash(event):
if event.button == 1:
decision['dec'] = 3
plt.close()
def createPlot(img):
plt.imshow(img)
yescut = plt.axes([0.4, 0.0, 0.1, 0.095])
nocut = plt.axes([0.6, 0.0, 0.1, 0.095])
trashcut = plt.axes([0.9, 0.0, 0.1, 0.095])
bcutyes = Button(yescut, 'YES', color='green', hovercolor='green')
bcutno = Button(nocut, 'NO', color='red', hovercolor='red')
bcuttrash = Button(trashcut, 'TRASH', color='BROWN', hovercolor='BROWN')
bcutyes.on_clicked(_yes)
bcutno.on_clicked(_no)
bcuttrash.on_clicked(_trash)
plt.show()