From 76550edd7c1ef79eddaa28dc02975f94c57a8038 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 7 Oct 2015 04:14:02 +0200 Subject: reproducible: half the height of the pkgs to be fixed graphs --- bin/make_graph.py | 8 +++++--- bin/reproducible_common.sh | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/make_graph.py b/bin/make_graph.py index 9bd3cad4..cf852a28 100755 --- a/bin/make_graph.py +++ b/bin/make_graph.py @@ -11,8 +11,8 @@ from rpy2 import robjects from rpy2.robjects.packages import importr def main(): - if len(sys.argv) != 6: - print "we need exactly five params: csvfilein, pngoutfile, color, mainlabel, ylabl" + if len(sys.argv) != 8: + print "we need exactly seven params: csv-file-in, png-out-file, color, mainlabel, ylabl, width, height" return filein = sys.argv[1] fileout = sys.argv[2] @@ -20,10 +20,12 @@ def main(): columns = str(int(colors)+1) mainlabel = sys.argv[4] ylabel = sys.argv[5] + width = int(sys.argv[6]) + height = int(sys.argv[7]) countsfile = os.path.join(filein) pngfile = os.path.join(fileout) grdevices = importr('grDevices') - grdevices.png(file=pngfile, width=1920, height=960, pointsize=10, res=100, antialias="none") + grdevices.png(file=pngfile, width=width, height=height, pointsize=10, res=100, antialias="none") r = robjects.r r('t <- (read.table("'+countsfile+'",sep=",",header=1,row.names=1))') r('cname <- c("date",rep(colnames(t)))') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 972ffe50..ef1572fd 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -598,13 +598,18 @@ create_png_from_table() { experimental) COLORS=42 ;; esac fi + local WIDTH=1920 + local HEIGHT=960 + if [ $1 -eq 8 ] ; then + HEIGHT=480 + fi # only generate graph if the query returned data if [ $(cat ${TABLE[$1]}.csv | wc -l) -gt 1 ] ; then echo "Updating $2..." DIR=$(dirname $2) mkdir -p $DIR echo "Generating $2." - /srv/jenkins/bin/make_graph.py ${TABLE[$1]}.csv $2 ${COLORS} "${MAINLABEL[$1]}" "${YLABEL[$1]}" + /srv/jenkins/bin/make_graph.py ${TABLE[$1]}.csv $2 ${COLORS} "${MAINLABEL[$1]}" "${YLABEL[$1]}" $WIDTH $HEIGHT mv $2 $BASE/$DIR [ "$DIR" = "." ] || rmdir $(dirname $2) # create empty dummy png if there havent been any results ever -- cgit v1.2.3-70-g09d2