1

I'm trying to make a gnuplot picture from a file, have a problem with the distribution of 'data.txt' file. The actual distribution is :

1 4  x1 
1 16 x2
4 4  x3
4 16 x4
8 4  x5
8 16 x6

The first line makes reference to the number of lines that i want, and the other colums make reference to the x and y axis.

I'm trying two approximations to make the picture without success:

  1. Use some gnuplot function to sketch the picture using the actual distribution that my file have. I have not found this command.

  2. Make a bash script to convert the actual file into another with the correct distribution

4 x1 x3 x5
16 x2 x4 x6

1
  • I haven't understood yet what you need the first column for. In your example I could deduce the desired output just using the second and third columns. Is your example too symmetric? Commented Dec 17, 2013 at 13:18

1 Answer 1

1

Addressing #2

awk '{a[$2] = a[$2] $3 " "} END {for (i in a) print i, a[i]}' file
4 x1 x3 x5
16 x2 x4 x6
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.