Thursday, January 8, 2015

Use gnuplot to generate charts automatically for batch script process

# yum install gnuplot

# cat a.txt

2015-1 192 163 300
2015-2 517 598 300
2015-3 771 750 300

# cat test_script

set terminal jpeg small
set boxwidth 0.5
plot "a.txt" using 2:xticlabels(1) with boxes lt rgb "#406090",\
     "a.txt" using 3 lt rgb "#40FF00",\
     "a.txt" using 4 with lines

# cat test_script | gnuplot > a.jpg

No comments: