#!/usr/bin/gnuplot -persist set xlabel "balls" set ylabel "weighings" set title "Eight Balls Problem" set xrange [2:1000] plot log(x)/log(2) title "binary", "data.txt" using 1:2 title "average" with lines #If you want to see all four graphs at once, uncomment the next line #plot log(x)/log(2) title "binary", plot "data.txt" using 1:3 title "best" with lines, "data.txt" using 1:4 title "worst" with lines, "data.txt" using 1:2 title "average" with lines