gnuplot

Plot one-liner generated data with gnuplot

In this post, I’ll demonstrate how to use gnuplot in a one-liner. We’ll use the pipe but unfortunately you cannot pipe raw data to gnuplot directly (as far as I know). The piped data should contain basic gnuplot commands on top. So, we’ll use the following template: very-complicated-data-generating-commands | sed -e "1i\plot '-' " | gnuplot -persist If you’re interested in quickly see how this works, try something simple:

gnuplot boxerror, barchart with error bars

When I was trying to generate an image containing scatter-plot and a barchart with error bars, I got stuck with barchart part. There were no demos or samples that produces the desired output. So, I ended up figuring it out myself. Below is the gnuplot code, data sample and the output. set term png size 500,400 set output "boxerror-test.png" set boxwidth 0.5 set style fill transparent solid 0.5 noborder set yrange [0:100] set xrange [0:5] plot "boxerror-test.