def show(self, source):
"""
This function ...
:param source:
:return:
"""
# Create a plot for the source
source.plot(title="Is this a " + self.description + "? (" + str(self.processed) + " out of " + str(self.number_of_files) + ")", show=False, scale="log")
# Set current and previous source
self.previous_source = self.current_source
self.current_source = source
# Axes
axyes = plt.axes([0.6, 0.05, 0.1, 0.075])
axno = plt.axes([0.7, 0.05, 0.1, 0.075])
axunsure = plt.axes([0.8, 0.05, 0.1, 0.075])
axback = plt.axes([0.1, 0.05, 0.1, 0.075])
# Buttons
yes_button = Button(axyes, 'Yes')
yes_button.on_clicked(self.save_yes)
no_button = Button(axno, 'No')
no_button.on_clicked(self.save_no)
unsure_button = Button(axunsure, 'Unsure')
unsure_button.on_clicked(self.dont_save)
back_button = Button(axback, 'Back')
back_button.on_clicked(self.go_back)
# Show the plot
plt.show()
# Increment the counter
self.processed += 1
# -----------------------------------------------------------------
评论列表
文章目录