0
votes

Hi I am looking for a quick and dirty answer,

I try to make a surface or contourplot with gnuplot from a data file. The problem is the fileformat:

  • Its all in one row
  • line 1 till line 32 contain the values for the x-coordinates 1-32 and y=1, line 33 is the value for x=1 and y=2 and so on...

I tried to do that with the "everyline" command but since they are not separated by a blank line this is not working. Since this data file is an output file and from my program I get many of them, it is not practicable to modify each of them. It would be best if I find a way to do that directly with gnuplot.

I also tried it with "sed" but I am not yet further than extracing values from a specific line to a specific line.

If someone could help me with a quick applicable solution for this problem, it would be great.

1
Please reread your question: If all is in one row, how can you have different lines? It might also help is you sketch the data file. - Christoph
You should add a representative sample of your data and make it clear exactly how you need to manipulate it. If you have already tried something, you should show that too. - Tom Fenech
give a sample of wanted output, i don't know gnuplot format - NeronLeVelu

1 Answers

0
votes

You could use awk to add the needed columns, e.g.,

splot "<awk '{print int(NR/32),NR%32,$1}' datafile" u 1:2:3 with points

I may have switched the x and y columns around