0
votes

I have three columns of data in a .dat file . The first column is the x coordinate value, the second column is the y coordinate value, and the third column is the data point, which is dependent on both the x and y coordinates. I want to plot every value of the third column of data versus every value of the first two columns (x and y coordinates of the same "line") giving a curve for every combination(each .dat line) in order to have N (number of combinations) curves in the same diagramm. For example..lets plot data of line 1 with x,y of line 1 --> curve 1 the same for curve 2 curve 3 etc...all these curves in the same diagramm

this is the .dat file format (x,y,data)

                                 .dat file
         x                          y                         data
  0.0000000000000000        0.0000000000000000        1.0000000000000000     
  6.66666666666666657E-002   0.0000000000000000       0.99925295784900281     
  0.13333333333333333        0.0000000000000000       0.99717167897454517     
  0.20000000000000001        0.0000000000000000       0.99416622424560275     
  0.26666666666666666        0.0000000000000000       0.99070882825542761     
  0.33333333333333331        0.0000000000000000       0.98719255818610696     
  0.40000000000000002        0.0000000000000000       0.98387860924473813     
  0.46666666666666667        0.0000000000000000       0.98090550759659945     
  0.53333333333333333        0.0000000000000000       0.97832263784606033     
  0.59999999999999998        0.0000000000000000       0.97612458355657861     
  0.66666666666666663        0.0000000000000000       0.97427724465100551     
  0.73333333333333328        0.0000000000000000       0.97273477472974534     
  0.80000000000000004        0.0000000000000000       0.97144934783540904     
  0.86666666666666670        0.0000000000000000       0.97037616025481399   

i think this job needs a script for gnuplot but im new at gnuplot so i dont know how to do it

the wanted outcome must be , many plotting lines for every combination (each .dat line) x,y,datain one diagramm

1

1 Answers

1
votes

It is not clear what the overall organization of your data file is. Possibly the answer is as simple as

  set surface explicit
  splot 'data' using 1:2:3 with lines

The first line prevents the file from being interpreted as a regular grid to which a surface would be fitted; i.e. just plot lines and leave it at that.

However if the x and y coordinates are not appropriately sorted in your data file you may have to do that first before feeding it to gnuplot. You may also have to place blank lines between blocks of uniform y coordinates in the file so that the generated lines are not connected by unwanted diagonals.