0

I have several files called data_x.dat, where x ranges from 1 to 10. I'm looking for something in gnuplot that would allow me to directly plot the second column agains the first one of all of the files in the same graph, instead of doing

p "data_1.dat" u 1:2, "data_2.dat" u 1:2, ..., "data_10.dat" u 1:2

which is slow to type. Something like:

p "data_*" u 1:2

is what I'm looking for. Does it exist for gnuplot?.

Thank you.

1 Answer 1

1

Use inline iterations:

plot for [i=1:10] sprintf("data_%d.dat", i) u 1:2
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.