0

I was trying to plot a 18 line graph with gnuplot, so I used the code below and it shows the non-string variable error.

plot for [num = 4560 : 5072 : 64] \
    "graph_".num.".dat" using 1:4 with lines lw 2 title "".num.".fast", \
    "graph_".num.".dat" using 1:2 with lines lw 2 title "".num.".slow"
replot

But when I only use one, it works perfectly. I thought it could be because of a maximum number of lines in the legend or something. How can I plot these 18 lines in the same graph?

1 Answer 1

1

Ok, I found the problem, you have to set the loop twice, because they are different plots.

plot for [num = 4560 : 5072 : 64] \
   "graphs/tam_".num.".dat" using 1:4 with lines lw 2 title "".num.".fast", \
     for [num = 4560 : 5072 : 64] \
    "graphs/tam_".num.".dat" using 1:2 with lines lw 2 title "".num.".slow"
replot
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.