0

I have two different data files named try_giants.dat and parameters_ks.dat. I want to plot 3rd column of 1st file vs. 2nd column of 2nd file.

1 Answer 1

4

With datafiles D1.csv

0 1 0
0 1 1
0 1 2
0 1 3
0 1 4

and D2.csv

0 10
0 20
0 30
0 40
0 50

you can plot the third column of D1.csv on the x-axis and the second column of D2.csv on the y-axis with

plot "< paste D1.csv D2.csv" u 3:5 w l

The paste command merges corresponding or subsequent lines of files giving you this output:

0 1 0   0 10
0 1 1   0 20
0 1 2   0 30
0 1 3   0 40
0 1 4   0 50

Hence, the third column of this file is the third column of D1.csv and the fifth column is the second column of D2.csv resulting in this plot:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.