You have a data file, the example you reference uses functions. In gnuplot you need to specify that you want to use lines (with lines
or in short w l
) if you want to join data points with lines. Also, I can see (1 1) on your graph. Also I noticed you defined style line 2
but then used ls 1
instead of ls 2
to plot your data (that is you're not using the style you previously defined). Try
plot "test_data.txt" u 1:2 w l ls 2
If you also want to see the points together with lines, then use with linespoints
or w lp
:
plot "test_data.txt" u 1:2 w lp ls 2