feedgnuplot: Bar charts

Assuming data that looks like labeled curves:

x1 c1 y1 c2 y1
x2 c1 y2 c2 y2

The default feedgnuplot will be points:

seq 10 \
 | awk '{print $1, "Doubled", $1*2, "Incremented", $1+2}' \
 | feedgnuplot \
    --domain \
    --dataid \
    --autolegend \
    --terminal "dumb ansi 120,40"

Default is --points

We can specify --points --lines to join the points:

With --points --lines

To get barcharts, we can override the curve selection expressions and insist on the histogram style:

seq 10 \
 | awk '{print $1, "Doubled", $1*2, "Incremented", $1+2}' \
 | feedgnuplot \
    --domain \
    --dataid \
    --usingall "2:xticlabels(1)" \
    --set "style data histogram" \
    --autolegend \
    --terminal "dumb ansi 120,40"

For clearer output try the following:

Example

Pretty example:

seq 10 \
 | awk '{print $1, "Doubled", $1*2, "Incremented", $1+2}' \
 | feedgnuplot \
    --domain \
    --dataid \
    --usingall "2:xticlabels(1)" \
    --set "style data histogram" \
    --autolegend \
    --terminal "dumb ansi 120,40" \
    --unset "grid" \
    --set "tic out" \
    --set "xtic nomirror" \
    --set "boxwidth 0.8 relative" \
    --set "style histogram gap 2" \
    --set "style fill solid border -1" \
    --set "key out textcolor variable" \
    --title "Some title" \
    --ymin -1 --ymax 21

Result

Published on: 14 Feb 2022