From 849a5ec670cd0707abc7b4ca90592444d07b559d Mon Sep 17 00:00:00 2001 From: Caner Candan Date: Mon, 22 Nov 2010 17:35:06 +0100 Subject: [PATCH] created two boxplot script files one to generate image the other to display with matplotlab --- eo/test/CMakeLists.txt | 1 + eo/test/boxplot.py | 8 ++++---- eo/test/boxplot_to_png.py | 14 ++++++++++++++ eo/test/t-openmp.cpp | 1 - 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100755 eo/test/boxplot_to_png.py diff --git a/eo/test/CMakeLists.txt b/eo/test/CMakeLists.txt index 8d7956ba..07dbee08 100644 --- a/eo/test/CMakeLists.txt +++ b/eo/test/CMakeLists.txt @@ -95,6 +95,7 @@ ELSEIF(ENABLE_CMAKE_TESTING) SET(RESOURCES boxplot.py + boxplot_to_png.py ) FOREACH(file ${RESOURCES}) diff --git a/eo/test/boxplot.py b/eo/test/boxplot.py index 2b5141af..39a65944 100755 --- a/eo/test/boxplot.py +++ b/eo/test/boxplot.py @@ -4,11 +4,11 @@ import pylab import sys if __name__ == '__main__': - if len(sys.argv) < 3: - print 'Usage: boxplot.py [Results files, ...] [output file in .png]' + if len(sys.argv) < 2: + print 'Usage: boxplot.py [Results files, ...]' sys.exit() - for i in range(1, len(sys.argv) - 1): + for i in range(1, len(sys.argv)): pylab.boxplot( [ [ float(value) for value in line.split() ] for line in open( sys.argv[i] ).readlines() ] ) - pylab.savefig( sys.argv[ len(sys.argv) - 1 ] ) + pylab.show() diff --git a/eo/test/boxplot_to_png.py b/eo/test/boxplot_to_png.py new file mode 100755 index 00000000..2b5141af --- /dev/null +++ b/eo/test/boxplot_to_png.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import pylab +import sys + +if __name__ == '__main__': + if len(sys.argv) < 3: + print 'Usage: boxplot.py [Results files, ...] [output file in .png]' + sys.exit() + + for i in range(1, len(sys.argv) - 1): + pylab.boxplot( [ [ float(value) for value in line.split() ] for line in open( sys.argv[i] ).readlines() ] ) + + pylab.savefig( sys.argv[ len(sys.argv) - 1 ] ) diff --git a/eo/test/t-openmp.cpp b/eo/test/t-openmp.cpp index c4e3ac03..f1ddffe8 100644 --- a/eo/test/t-openmp.cpp +++ b/eo/test/t-openmp.cpp @@ -13,7 +13,6 @@ #include #include -#include #include