3

Basically, I want to combine http://t16web.lanl.gov/Kawano/gnuplot/datafile2-e.html#7.4 and http://t16web.lanl.gov/Kawano/gnuplot/datafile2-e.html#7.2. I'm trying to get a gnuplot script with embedded plaintext data points to plot using three different colours all in one plot command, like so:

plot \
    "-" index 0 title "waveform" with lines, \
    "-" index 1 title "-trig"    with lines, \
    "-" index 2 title "+trig"    with lines
    1418    -0.04
    1419    -0.04
    1420    +5.28
    1421    +5.20
    1422    +5.16

    1418    3.66
    1422    3.66

    1418    3.86
    1422    3.86
end

However, it just displays the three blocks in one colour and throws an error on the second and third index commands.

1 Answer 1

1

Never mind, I finally guessed it into working:

plot \
    "-" title ""      with lines, \
    "-" title "-trig" with lines, \
    "-" title "+trig" with lines
    1418    -0.04
    1419    -0.04
    1420    +5.28
    1421    +5.20
    1422    +5.16
end
    1418    3.66
    1422    3.66
end
    1418    3.86
    1422    3.86
end
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.