#NEWLINE# def _compute_min_max( self ) : #NEWLINE# #INDENT# ' compute y axis limits and units ' #NEWLINE# maxi = max ( [ max ( s . values . _get_cache ( ) ) for s in self . _series ] ) #NEWLINE# mul = None #NEWLINE# if ( maxi < 1 ) : #NEWLINE# #INDENT# s = str ( maxi ) . split ( '.' ) [ 1 ] #NEWLINE# mul = 10 #NEWLINE# for x in s : #NEWLINE# #INDENT# if ( x == '0' ) : #NEWLINE# #INDENT# mul *= 10 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# maxi = ( maxi * mul ) #NEWLINE# #UNINDENT# maxi = math . ceil ( ( maxi * 1.1 ) ) #NEWLINE# sz = ( len ( str ( int ( maxi ) ) ) - 1 ) #NEWLINE# unit = math . ceil ( ( math . ceil ( ( maxi / pow ( 10 , sz ) ) ) * pow ( 10 , ( sz - 1 ) ) ) ) #NEWLINE# maxi = ( math . ceil ( ( maxi / unit ) ) * unit ) #NEWLINE# if ( mul is not None ) : #NEWLINE# #INDENT# maxi = ( maxi / mul ) #NEWLINE# unit = ( unit / mul ) #NEWLINE# #UNINDENT# if ( ( maxi / unit ) > 9 ) : #NEWLINE# #INDENT# unit *= 2 #NEWLINE# #UNINDENT# self . y_axis . max = maxi #NEWLINE# self . y_axis . unit = unit