1

I have a data file, looking like

550 1.436e+00 7.857e-01 5.906e-01 4.994e-01 4.574e-01 4.368e-01 4.260e-01 4.273e-01 4.296e-01 4.406e-01 4.507e-01 4.639e-01 4.821e-01 5.008e-01 5.156e-01 5.378e-01 5.589e-01 5.768e-01 5.970e-01 6.196e-01 6.422e-01 6.642e-01

The first column is for x-axis, the rest ones are for the y-axis, 22 curves totally.

I want to plot the data so that y tics represent cube roots of the values. Actually, I want my cubic curves to become linear, to show, that they're cubic in the normal coordinates (and it is fixed by my task to use these coordinates).

I tried to use the following command:

plot for [i=2:23] datafile using 1:(i ** .333) smooth cspline

It expects column number in place of i. I know, the following is correct:

plot datafile using 1:($2 ** .333) smooth cspline

giving me the desired plot for my first line. But how do I modify this for plot for?

1 Answer 1

3

If you want the column number in place of i, you should use column(i) in the using specification.

plot for [i=2:23] datafile using 1:(column(i) ** .333) smooth cspline
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you, I've lost my hope googling!
@gluk47 -- No problem. This isn't one you run into very frequently since the shorthand $X is much more common in the documentation, but I'm guessing $i doesn't work here (although I haven't tried it ...)
$i does not work, I tried it first of all. I forgot to mention it in my question.

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.