diff --git a/bin/logtool b/bin/logtool index 7b66471ae6a5133b8d67905aca5de734c5b914d5..2eb810b71cc7fa53e0d04118bb92727973840bf3 100755 --- a/bin/logtool +++ b/bin/logtool @@ -16,11 +16,15 @@ following: parser = OptionParser(usage="%prog FILE COMMANDS FILE COMMANDS...", description=description) + parser.add_option("--scale-x", metavar="XMIN,XMAX", + help="Set the scale of the X axis") + parser.add_option("--scale-y", metavar="YMIN,YMAX", + help="Set the scale of the Y axis") parser.add_option("--units-x", - help="No description on the X axis", + help="Show only units, not descriptions on the X axis", action="store_true") parser.add_option("--units-y", - help="No description on the Y axis", + help="Show only units, not descriptions on the Y axis", action="store_true") parser.add_option("--legend-expr", help="Generate a legend from the expression", @@ -102,10 +106,17 @@ following: logmgr.load(cmd) if did_plot: - from pylab import show, title, legend + from pylab import show, title, legend, axis if options.legend_expr or options.legend_descr: legend() + xmin, xmax, ymin, ymax = axis() + if options.scale_x: + xmin, xmax = [float(x) for x in options.scale_x.split(",")] + if options.scale_y: + ymin, ymax = [float(x) for x in options.scale_y.split(",")] + axis((xmin, xmax, ymin, ymax)) + title(options.title) show()