2

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.

Eric Carvalho
  • 54,385
Mohammad Reza Rezwani
  • 10,286
  • 36
  • 92
  • 128
  • I think this is either a bot trying to get reputation or a reputation scam. Not sure, but feel free to check: http://ubuntu.aspcode.net/view/635400140124705175518366/gnuplot-make-a-chart-with-one-column-witch-in-not-exict and http://w3facility.org/question/gnuplot-make-a-chart-with-one-column-witch-in-not-exict/ – don.joey Nov 27 '14 at 17:16

2 Answers2

6

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"
0

I was able to get this working by cat'ing the file and then plotting: cat temp.dat | gnuplot -p -e "plot '<cat' with linespoints"

james-see
  • 244
  • 2
  • 9