histo.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/bash
  2. #
  3. # StarPU
  4. # Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. # generate the input data
  18. ./fxt_tool $1
  19. # generate the gnuplot script
  20. echo "#!/usr/bin/gnuplot -persist" > histo.gp
  21. echo "set term postscript eps enhanced color" >> histo.gp
  22. echo "set output \"histo.eps\"" >> histo.gp
  23. echo "set boxwidth 0.75 absolute" >> histo.gp
  24. echo "set boxwidth 0.75 absolute" >> histo.gp
  25. echo "set nokey" >> histo.gp
  26. echo "set style fill solid 1.00 border -1" >> histo.gp
  27. #echo "set key invert samplen 4 spacing 1 width 0 height 0" >> histo.gp
  28. #echo "set style histogram rowstacked title offset character 0, 0, 0" >> histo.gp
  29. echo "set style histogram rowstacked" >> histo.gp
  30. echo "set style data histograms" >> histo.gp
  31. echo "set xtics border in scale 1,0.5 nomirror rotate by -45 offset character 0, 0, 0" >> histo.gp
  32. #and the actual plotting part :
  33. ncols=`head -1 data |wc -w`
  34. color="red"
  35. echo "plot \\" >> histo.gp
  36. for i in `seq 1 $(($ncols - 2))`
  37. do
  38. if [ $color == "red" ];
  39. then
  40. color="green"
  41. else
  42. color="red"
  43. fi
  44. echo "\"data\" using $i lt rgb \"$color\",\\" >> histo.gp
  45. done
  46. if [ $color == "red" ];
  47. then
  48. color="green"
  49. else
  50. color="red"
  51. fi
  52. echo "\"data\" using $(($ncols - 1)) lt rgb \"$color\"" >> histo.gp
  53. # now call the script
  54. gnuplot histo.gp