2

I know that

gnuplot> p 'filename' 

would plot the graph

I wanted to know how does this code exactly run

gnuplot> p 'filename' u 10:(($3==4 && $9==1000)?$13:1/0) w lp

1 Answer 1

1

First of all, it helps a bit to expand the abbreviated commands (you are taking these from someone else's script, I assume):

plot 'filename' using 10:(($3==4 && $9==1000) ? $13 : 1/0) with linespoints

That snippet is meant to plot the 10th vs. the 13th column from a big data file based on the values in the third and ninth columns. The first argument to using is 10, so the value in the 10th column is the x coordinate of each point. The y values are determined thus: if the value in the 3rd column is 4 and the value in the 9th column is 1000, the value from the 13th column is plotted; otherwise 1/0 (no value) is plotted. That is done by the ternary operator <condition> ? <operation if true> : <operation if false>.

with linespoints means the points plotted will be connected by lines.

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.