GeezerVison is showing github.com — Fix --nosummary flag · Aluriak/bashplotlib@4521b39
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bashplotlib/histogram.py +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -50,7 +50,7 @@ def run_demo(): | 50 | 50 | print "hist -f ./data/exp.txt -s 35.0 -b 40" | 51 | 51 | plot_hist('./data/exp.txt', height=35.0, bincount=40) | 52 | 52 |
| 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): | 54 | 54 | """make a histogram | 55 | 55 |
| 56 | 56 | Keyword arguments: | @@ -60,7 +60,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="", | 60 | 60 | colour -- colour of the bars in the terminal | 61 | 61 | title -- title at the top of the plot | 62 | 62 | 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 | 64 | 64 | """ | 65 | 65 |
| 66 | 66 | if pch is None: | @@ -135,7 +135,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="", | 135 | 135 | center = max(map(len, map(str, [n, min_val, mean, max_val]))) | 136 | 136 | center += 15 | 137 | 137 |
| 138 | | - if nosummary is not True: | | 138 | + if showSummary: | 139 | 139 | print | 140 | 140 | print "-"*(2 + center) | 141 | 141 | print "|" + "Summary".center(center) + "|" | @@ -165,7 +165,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="", | 165 | 165 | parser.add_option('-c', '--colour', help='colour of the plot (%s)' % ", ".join([c for c in bcolours.keys() if c != 'ENDC']), | 166 | 166 | default='white', dest='colour') | 167 | 167 | 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) | 169 | 169 |
| 170 | 170 | (opts, args) = parser.parse_args() | 171 | 171 |
| @@ -178,7 +178,7 @@ def plot_hist(f, height=20.0, bincount=None, pch="o", colour="white", title="", | 178 | 178 | if opts.demo: | 179 | 179 | run_demo() | 180 | 180 | 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) | 182 | 182 | else: | 183 | 183 | print "nothing to plot!" | 184 | 184 |
|
Collapse file Copy file name to clipboardExpand all lines: bin/hist +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,7 +22,7 @@ if __name__=="__main__": | 22 | 22 | parser.add_option('-x', '--xlab', help='label bins on x-axis', default=None, action="store_true", dest='x') | 23 | 23 | parser.add_option('-c', '--colour', help='colour of the plot (%s)' % ", ".join([c for c in bcolours.keys() if c != 'ENDC']), | 24 | 24 | default='white', dest='colour') | 25 | | - parser.add_option('-n', '--nosummary', help='hide summary', action='store_false', dest='nosummary') | | 25 | + parser.add_option('-n', '--nosummary', help='hide summary', action='store_false', dest='showSummary', default=True) | 26 | 26 |
| 27 | 27 | (opts, args) = parser.parse_args() | 28 | 28 |
| @@ -33,7 +33,7 @@ if __name__=="__main__": | 33 | 33 | opts.f = sys.stdin.readlines() | 34 | 34 |
| 35 | 35 | if opts.f: | 36 | | - plot_hist(opts.f, opts.h, opts.b, opts.p, opts.colour, opts.t, opts.x, opts.nosummary) | | 36 | + plot_hist(opts.f, opts.h, opts.b, opts.p, opts.colour, opts.t, opts.x, opts.showSummary) | 37 | 37 | else: | 38 | 38 | print "nothing to plot!" | 39 | 39 |
|
|