def switch_graphics(self, variable, frame): """ Change the graphic disposition to allow to pass from one to two graphics. Thus it allows you to go from wavelengths to wavelengths + fft. Parameters: variable : This is linked to the FFT+Wave checkbox it is updated when you check it. frame : Tkinter frame that contains the frame. """ state = variable.get() # Destroy all the element unwanted and create the double graph if state == 'enable': self.wv_graphic.destroy_graph() self.dual = Graphic.SubGraphFrame( parent=frame, subplots={ 'WV': ['Wavelength [nm]', 'Intensities [counts]'], 'FFT': ['Time [fs]', 'Intensities [counts]'] }, figsize=[9, 6]) self.fft_graphic = self.dual.graph[1] self.wv_graphic = self.dual.graph[0] self.adjust_wavelength_range() # Destroy all the element unwanted from the dual graph and recreate the # wv_graphic elif state == 'disable': if not self.dual: return self.dual.destroy_graph() self.dual = None self.wv_graphic = Graphic.GraphicFrame( frame, axis_name=['Wavelength [nm]', 'Intensity [counts]'], figsize=[9, 6]) self.fft_graphic = None self.fft_centered = False