I have a txt file with names and quantities, for example:
1 70 cats
2 64 dogs
3 54 birds
4 30 turtles
how can I, only with gnuplot, generate a chart in which the names below and their respective quantities appear on the right ?
I have a txt file with names and quantities, for example:
1 70 cats
2 64 dogs
3 54 birds
4 30 turtles
how can I, only with gnuplot, generate a chart in which the names below and their respective quantities appear on the right ?
If the graph you want to create is just a point chart, you can do it by combining the with points
and with labels
plots. Here is a sample code.
$TestData <<EOD
1 70 cats
2 64 dogs
3 54 birds
4 30 turtles
5 25 "other animals"
EOD
set xrange [0:6]
set yrange [0:100]
set key noautotitle
plot $TestData using 1:2 with points ps 2 pt 7, \
"" using 1:2:(strcol(3)) with labels offset 0,-1 center, \
"" using 1:2:(strcol(2)) with labels offset 2,0 left