0

I want to plot several functions on the same plot on gnuplot using file data. One way of doing this is:

set multiplot
plot 'data.dat' using 1:2
plot 'data.dat' using 1:3
...

I want to know if there is a quicker way to do it. I have to plot around 10 functions on the same plot and that can get slow. Something like that would be ideal:

plot 'data.dat' using 1:2, using 1:3, using 1:4, ... using 1:n with lines

1 Answer 1

2

That's almost correct, just use

set style data lines
plot 'data.dat' using 1:2, '' using 1:3, '' using 1:4

This doesn't require multiplot mode.

With version 4.6 you can also iterate over the columns:

plot for [i=2:4] 'data.dat' using 1:i
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.