@@ -159,7 +159,7 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="def
159159 nlen = max (len (str (min_y )), len (str (max_y ))) + 1
160160
161161 if title :
162- print (box_text (title , max (len (hist ) * 2 , len (title )), nlen ))
162+ print (box_text ([ title ] , max (len (hist ) * 2 , len (title )), nlen ))
163163 print ()
164164
165165 used_labs = set ()
@@ -202,17 +202,15 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="def
202202 center += 15
203203
204204 if showSummary :
205- print ()
206- print ("-" * (2 + center ))
207- print ("|" + "Summary" .center (center ) + "|" )
208- print ("-" * (2 + center ))
209- summary = "|" + ("observations: %d" % n ).center (center ) + "|\n "
210- summary += "|" + ("min value: %f" % min_val ).center (center ) + "|\n "
211- summary += "|" + ("mean : %f" % mean ).center (center ) + "|\n "
212- summary += "|" + ("std dev : %f" % sd ).center (center ) + "|\n "
213- summary += "|" + ("max value: %f" % max_val ).center (center ) + "|\n "
214- summary += "-" * (2 + center )
215- print (summary )
205+ summary_lines = [
206+ "## Summary ##" .center (center ),
207+ ("observations: %d" % n ).center (center ),
208+ ("mean : %f" % mean ).center (center ),
209+ ("std dev : %f" % sd ).center (center ),
210+ ("max value: %f" % max_val ).center (center ),
211+ ("min value: %f" % min_val ).center (center ),
212+ ]
213+ print (box_text (summary_lines , center ))
216214
217215
218216def main ():
0 commit comments