@@ -50,7 +50,7 @@ def run_demo():
5050 print "hist -f ./data/exp.txt -s 35.0 -b 40"
5151 plot_hist ('./data/exp.txt' , height = 35.0 , bincount = 40 )
5252
53- def plot_hist (f , height = 20.0 , bincount = None , pch = "o" , colour = "white" , title = "" , xlab = None , nosummary = True ):
53+ def plot_hist (f , height = 20.0 , bincount = None , pch = "o" , colour = "white" , title = "" , xlab = None , showSummary = False ):
5454 """make a histogram
5555
5656 Keyword arguments:
@@ -60,7 +60,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="",
6060 colour -- colour of the bars in the terminal
6161 title -- title at the top of the plot
6262 xlab -- boolen value for whether or not to display x-axis labels
63- nosummary -- boolean value for whether or not to display a summary
63+ showSummary -- boolean value for whether or not to display a summary
6464 """
6565
6666 if pch is None :
@@ -135,7 +135,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="",
135135 center = max (map (len , map (str , [n , min_val , mean , max_val ])))
136136 center += 15
137137
138- if nosummary is not True :
138+ if showSummary :
139139 print
140140 print "-" * (2 + center )
141141 print "|" + "Summary" .center (center ) + "|"
@@ -165,7 +165,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="",
165165 parser .add_option ('-c' , '--colour' , help = 'colour of the plot (%s)' % ", " .join ([c for c in bcolours .keys () if c != 'ENDC' ]),
166166 default = 'white' , dest = 'colour' )
167167 parser .add_option ('-d' , '--demo' , help = 'run demos' , action = 'store_true' , dest = 'demo' )
168- parser .add_option ('-n' , '--nosummary' , help = 'run demos ' , action = 'store_true ' , dest = 'nosummary' )
168+ parser .add_option ('-n' , '--nosummary' , help = 'hide summary ' , action = 'store_false ' , dest = 'showSummary' , default = True )
169169
170170 (opts , args ) = parser .parse_args ()
171171
@@ -178,7 +178,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="",
178178 if opts .demo :
179179 run_demo ()
180180 elif opts .f :
181- plot_hist (opts .f , opts .h , opts .b , opts .p , opts .colour , opts .t , opts .x , opts .nosummary )
181+ plot_hist (opts .f , opts .h , opts .b , opts .p , opts .colour , opts .t , opts .x , opts .showSummary )
182182 else :
183183 print "nothing to plot!"
184184
0 commit comments