def update_button_action(self):
        """ when update button is clicked, refresh the data preview"""
        if self.mode.get() == 3:  # threecolor
            self.configure_threecolor_image()
        elif self.mode.get() == 1:  # singlecolor
            self.configure_singlecolor_image()
        else:
            raise ValueError("mode can only be singlecolor or threecolor")

        self.imageplot.set_data(self.image)
        if self.mode.get() == 1:  # singlecolor
            self.imageplot.set_cmap('gist_gray')
        self.fig.canvas.draw_idle()
def update_button_action ( self ) : if self . mode . get ( ) == 3 : self . configure_threecolor_image ( ) elif self . mode . get ( ) == 1 : self . configure_singlecolor_image ( ) else : raise ValueError ( "mode can only be singlecolor or threecolor" ) self . imageplot . set_data ( self . image ) if self . mode . get ( ) == 1 : self . imageplot . set_cmap ( 'gist_gray' ) self . fig . canvas . draw_idle ( )
when update button is clicked, refresh the data preview