#NEWLINE# def on_cursor( self , event = None , side = 'left' ) : #NEWLINE# #INDENT# if ( event is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# ( x , y ) = ( event . xdata , ix1 . ydata ) #NEWLINE# if ( len ( self . panel . fig . get_axes ( ) ) > 1 ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( x , y ) = self . panel . axes . transData . inverted ( ) . transform ( ( event . x , event . y ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# ix = x #NEWLINE# if ( self . mca is not None ) : #NEWLINE# #INDENT# ix = index_of ( self . mca . energy , x ) #NEWLINE# #UNINDENT# if ( side == 'right' ) : #NEWLINE# #INDENT# self . xmarker_right = ix #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( side == 'left' ) : #NEWLINE# #INDENT# self . xmarker_left = ix #NEWLINE# #UNINDENT# #UNINDENT# if ( ( self . xmarker_left is not None ) and ( self . xmarker_right is not None ) ) : #NEWLINE# #INDENT# ( ix1 , ix2 ) = ( self . xmarker_left , self . xmarker_right ) #NEWLINE# self . xmarker_left = min ( ix1 , ix2 ) #NEWLINE# self . xmarker_right = max ( ix1 , ix2 ) #NEWLINE# #UNINDENT# if ( side == 'left' ) : #NEWLINE# #INDENT# self . energy_for_zoom = self . mca . energy [ ix ] #NEWLINE# #UNINDENT# self . update_status ( ) #NEWLINE# self . draw ( )