Gnuplot: Plotting from a data file

gnuplot

Im having the dreaded warning: Skipping unreadable file "edit1.txt". No data in plot error message. Ive tried plotting sin(x) and that works fine so im assuming its the way i have formatted my file.

ive copied in the following data (2 columns separated by tabs)

2   6
5   9
7   4

saved the encoding as ANSI and typed

plot 'edit.dat'

i also tried the following data(4 columns separated with spaces)

-1.0000    0.0000     0.0000     1.0000
-0.9000    0.5700     1.1769     0.7150
-0.8000    1.0800     1.4400     0.4600
-0.7000    1.5300     1.4997     0.2350
-0.6000    1.9200     1.4400     0.0400
-0.5000    2.2500     1.2990    -0.1250
-0.4000    2.5200     1.0998    -0.2600
-0.3000    2.7300     0.8585    -0.3650

saving the file as a .dat, Mac terminators -CR and ANSI/ASCII encoding. this didnt work either.

If someone could point out where ive screwed up id appreciate it.

Best Solution

Gnuplot should be able to read your data just fine.

Make sure the file that contains the data exists. Otherwise you can try putting the data after the plot itself in the gnuplot script with:

plot "-" u 1:2 w l
1 2
2 3
3 4
4 5
e

and run that with

gnuplot <script_name> --persist.

Related Question