From 4bff8dc35059f69e79d75b679a0e28cca5322785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=2E=20Brandenburg?= Date: Sat, 27 Mar 2010 20:18:17 -0400 Subject: make y-axis logarithmic on demand --- plot_pm2.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'plot_pm2.py') diff --git a/plot_pm2.py b/plot_pm2.py index 1332825..09b2d49 100755 --- a/plot_pm2.py +++ b/plot_pm2.py @@ -103,6 +103,7 @@ options = [ o(None, '--paper', action='store_true', dest='paper'), o(None, '--wide', action='store_true', dest='wide'), o(None, '--split', action='store_true', dest='split'), + o(None, '--log-y', action='store_true', dest='logy'), o(None, '--extend', action='store', type='float', dest='extend'), o(None, '--aggregate', action='store_true', dest='aggregate'), o('-c', '--cycles-per-usec', action='store', type='float', dest='cycles_per_usec'), @@ -116,6 +117,7 @@ defaults = { 'aggregate' : False, 'extend' : 1.5, 'cycles_per_usec' : None, + 'logy' : False, } def extract_cols(data, xcol, ycol1, ycol2, cast=int, cpu_filter=lambda x, y: True): @@ -363,6 +365,11 @@ class CyclePlotter(defapp.App): rw = int(conf['wcycle']) rw = 1.0 / rw * 100 if rw != 0 else 0 + if self.options.logy: + axis = ("x 2", "y 10") + else: + axis = "x 2" + # raw measures for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: graphs = [] @@ -380,8 +387,9 @@ class CyclePlotter(defapp.App): yrange = None #(4096, 2**26) fname = "%s_full_%s" % (name, kind) + gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, - yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) + yrange=yrange, logscale=axis, format=self.options.format) # per-sample delta measures for offset, kind, long in [(0, 'avg', 'average'), (2, 'wc', 'maximum')]: @@ -399,7 +407,7 @@ class CyclePlotter(defapp.App): fname = "%s_delta_%s" % (name, kind) gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, - yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) + yrange=yrange, logscale=axis, format=self.options.format) del tmp # stats delta @@ -435,7 +443,7 @@ class CyclePlotter(defapp.App): fname = "%s_diff_%s" % (name, kind) gnuplot(graphs, xlabel=xlabel, ylabel=ylabel, title=title, fname=fname, - yrange=yrange, logscale=("x 2", "y 10"), format=self.options.format) + yrange=yrange, logscale=axis, format=self.options.format) del tmp def plot_file(self, datafile): -- cgit v1.2.2