#NEWLINE# def _init_views( self , min_value , max_value ) : #NEWLINE# #INDENT# 'Generate initial data for each histogram view.' #NEWLINE# if ( not self . base_size ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# ( min_value , max_value ) = ( ( min_value or 0 ) , ( max_value or 0 ) ) #NEWLINE# views = [ ] #NEWLINE# for ( view , bins ) in [ ( 'Square Root Choice' , int ( math . ceil ( math . sqrt ( self . base_size ) ) ) ) , ( 'Sturges Formula' , int ( math . ceil ( ( math . log ( self . base_size , 2 ) + 1 ) ) ) ) , ( 'Rice Rule' , int ( math . ceil ( ( 2 * ( self . base_size ** ( 1.0 / 3 ) ) ) ) ) ) ] : #NEWLINE# #INDENT# bin_width = ( float ( ( max_value - min_value ) ) / bins ) #NEWLINE# x_axis = [ ( min_value + ( bin_width * x ) ) for x in range ( 1 , ( bins + 1 ) ) ] #NEWLINE# views . append ( { #NEWLINE# #INDENT# 'view' : view , #NEWLINE# 'bins' : bins , #NEWLINE# 'x' : x_axis , #NEWLINE# 'y' : ( [ 0 ] * len ( x_axis ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return views