Ubuntu – simple example of gnuplot

gnuplot

I want to write gnuplot command for a file which just I have one column of that. In the file and that column is Y, But in the file I don't have X's column.X's column element are

1
2
3
4
5
6
7

.Pay attention to the belowe think they are my in file witch they
"

12
43
65
76
12
56

"
As you see I have Y's element but I do not have X's element in my file,I mean X elemat is based on the row number.I guess there should be an command in gnuplot which does this.

Best Answer

This is the default behaviour for single column files. The difference is that the standard numbering is to number x=0,1,2,...

Here's my data (in file temp.dat)

12 
43 
65 
76 
12 
56

Plot with

    gnuplot> plot "temp.dat" with linespoints title "Single column data"

or similar.

To shift the x-axis so that x=1,2,3...

    gnuplot> plot "temp.dat" using ($0+1):1 with linespoints title "Single column data"
Related Question