0

I have data in the form:

1.23420394 3.2342423 4.2390424 1.2423424 3.3243242 1.2342522 3.4092843
8.92348209 2.3940284 4.21313   2.340242  3.342424  3.9875894 1.3423434

and it goes on for a long list. I took the data from excel and exported it to a txt file.

I am trying to plot this is gnuplot with:

plot for [col=2:7] "filename.txt" using  1:col

It first wasn't working at all until i went in manually and deleted all invisibles and replaced them with spaces. Now, it only recognizes the first line. Gnuplot uses the first column as x and the rest of the columns as corresponding y values. I'm not sure why this happens.

Steven
  • 119
  • 2
  • 15
  • 1
    if running on *nix, use `dos2unix datFile1 datFile2 DatFile3 ....` to change line endings from `\r\n` to `\n`. Good luck. – shellter Sep 29 '15 at 22:06
  • 1
    Why have you removed your previous question? I had been waiting for any response on my comment. Gnuplot needs newlines in the data files, but has problems with only `\r` (I don't have the link again at hand). So, in case that is actually the problem, replace all `\r` with `\n` or `\r\n`. Then it should work. – Christoph Sep 30 '15 at 06:50
  • sorry about deleting the previous question, there was an issue with it. also, dos2unix still didn't make gnuplot read anything besides the first line :( – Steven Sep 30 '15 at 17:29
  • use `cat -vet file | head -10` to see what is in the first 10 lines. If you see any thing like `^M` or `^H` or `^B` or really any `^` chars, you should focus then on getting a straight ascii output with `\n` (maybe `\r\n` endings are OK too). Did you use the `export as TSV` options (recommended). Good luck. – shellter Sep 30 '15 at 20:23
  • See [Remove carriage return in Unix](http://stackoverflow.com/q/800030/2604213) for some comments about carriage returns. Here, removing them with `sed 's/\r/\n/g' file` worked, but I cannot test, if this also works on MacOS – Christoph Oct 01 '15 at 08:03

0 Answers0