1

I want plot in gnuplot one curve using multiple data files in format like this:

dat1.dat

time x y
1 2 3
2 3 4
3 4 5

dat2.dat

time1 x1 y1
4 5 6
5 6 7
6 7 8

I want draw one curve in that way: (time, x) and (time1, x*5) combine together.

I know that I can do something like that:

plot "dat1.dat" using 1:2, \
     "dat2.dat" using 1:($2*5)

and this is nearly what I want to have, but then, I've got two curves with two titles in legend, different colors. I want to have one curve in the single graph with one title in legend.

1
  • What do you already know of plotting? And what did you already try? Commented Oct 5, 2015 at 20:27

1 Answer 1

1

If you want both lines to have the same linetype you must set it explicitely. Also, to have only a single legend, set the title only for the first plot, and unset it for the second plot:

plot "dat1.dat" using 1:2 linetype 1 title "data",\
     "dat2.dat" using 1:($2*5) linetype 1 notitle`
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.