0

I have 3d data that makes a surface when plotted in 3d:

x1  y1  f(x1, y1)
x1  y2  f(x1, y2)
..  ..  ..
x1  yn  f(x1, yn)


x2  y1  f(x1, y1)
x2  y2  f(x1, y2)
..  ..  ..
x2  yn  f(x1, yn)


.
.

I can use gnuplot to get level curve for x=constant by using :

plot "datafile.txt" u 2:3 index 0      //or index 1 etc

How can I get plot for y=constant ?

Thanks for reply in advance...

1 Answer 1

1

1st possibility: plot the whole file, and make all unwanted datapoints invalid (NaN or 1/0)

yfix = 5 # the constant y value
plot datafile using (($2 == yfix) ? $1 : NaN):3

2nd possibility: the every specifier

n = 3 # number of the wanted sample in y-direction
plot datafile every ::n::n using 1:3

It takes as option (line increment):(block increment):(first line):(first block):(last line):(last block)

So the command above plots only the n'th line from each block, resp. dataset.

(note: blocks are separated by a single blank line, datasets by an additional second blank line. The latter are specified with index, the former addressed via every)

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.