Gnuplot does not recognize plot for syntax

I am trying to use for syntax for multiple columns.

I have a colhead.dat data file:

Id a1 a2 a3 1 1 2 3 2 2 3 4 3 2 3 4 

After the answer is https://stackoverflow.com/a/2902169/

 gnuplot> plot for [i=2:5] 'colhead.dat' u 1:iw lp title columnheader(i) ^ ':' expected 

How to write a for loop? Here is the gnuplot version title

 Version 4.2 patchlevel 6 last modified Sep 2009 System: Linux 2.6.32-71.el6.x86_64 
+1
source share
1 answer

For-loops were implemented in version 4.6 of gnuplot, and in versions previously there was nothing like loops. So you need to update your version!


Edit: As Christophe mentioned, the first for functionality was introduced in 4.4. However, 4.2 is too old.

+3
source

Source: https://habr.com/ru/post/1490207/


All Articles