1

How can you assign only one title to a line when you also use a for loop?

I have the follwoing command line:

plot for [i=1:15] "test.txt" using (i-1):i title "test" lc rgb "red" ps 0.4 lw 0.5

But the title is of course repeated 15 times. I would like the title to appear only for one time. Is there a way to avoid this without using label? I have searched but nothing looks interesting.

1 Answer 1

2

Empty titles are omitted. Simply check variable i:

plot for [i=1:15] "test.txt" using (i-1):i title (i == 1 ? "test" : "")
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.