diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-21 17:21:47 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-21 17:21:47 -0500 |
| commit | 4c71aaaebec1cb9a05923c085503571f95016cc0 (patch) | |
| tree | d41de7d3ffabf7ef5e2d854d7354f79e4f17352c | |
| parent | 56267a16bab916d5baa4fa7344520e395110fd90 (diff) | |
support plotting on a log scale
| -rwxr-xr-x | oplot.py | 15 |
1 files changed, 12 insertions, 3 deletions
| @@ -41,7 +41,10 @@ options = [ | |||
| 41 | o('-b', '--binsize', action='store', dest='binsize', type='float', | 41 | o('-b', '--binsize', action='store', dest='binsize', type='float', |
| 42 | help='set binsize of histogram'), | 42 | help='set binsize of histogram'), |
| 43 | 43 | ||
| 44 | ] | 44 | o(None, '--ylog', action='store_true', dest='ylog', |
| 45 | help='use logarithmic y-axis'), | ||
| 46 | |||
| 47 | ] | ||
| 45 | 48 | ||
| 46 | defaults = { | 49 | defaults = { |
| 47 | # output options | 50 | # output options |
| @@ -60,7 +63,7 @@ defaults = { | |||
| 60 | 63 | ||
| 61 | 'xmax' : None, | 64 | 'xmax' : None, |
| 62 | 'ymax' : None, | 65 | 'ymax' : None, |
| 63 | 66 | 'ylog' : False, | |
| 64 | } | 67 | } |
| 65 | 68 | ||
| 66 | 69 | ||
| @@ -213,11 +216,17 @@ class OverheadPlotter(defapp.App): | |||
| 213 | % self.options.binsize | 216 | % self.options.binsize |
| 214 | 217 | ||
| 215 | if self.options.ymax: | 218 | if self.options.ymax: |
| 216 | p.yrange = (0, self.options.ymax) | 219 | if self.options.ylog: |
| 220 | ymin = 0.5 if not self.options.normalize else 0.0001 | ||
| 221 | else: | ||
| 222 | ymin = 0 | ||
| 223 | p.yrange = (ymin, self.options.ymax) | ||
| 217 | # p.yrange = (0, (ceil(numpy.amax(hist[:,1]) / 100.0) * 100)) | 224 | # p.yrange = (0, (ceil(numpy.amax(hist[:,1]) / 100.0) * 100)) |
| 218 | p.xticks = (0, 10) | 225 | p.xticks = (0, 10) |
| 219 | p.curves = [curve(histogram=fname, col=2, labels_col=4)] | 226 | p.curves = [curve(histogram=fname, col=2, labels_col=4)] |
| 220 | 227 | ||
| 228 | p.ylog = self.options.ylog | ||
| 229 | |||
| 221 | #### Styling. | 230 | #### Styling. |
| 222 | 231 | ||
| 223 | if not self.setup_png(p): | 232 | if not self.setup_png(p): |
