For what regards multiple for
in a single plot
command, the syntax is documented in the inline help of gnuplot
Nested iteration is supported:
set for [i=1:9] for [j=1:9] label i*10+j sprintf("%d",i*10+j) at i,j
E.g.,
gnuplot> plot for[a=0:1] for[b=0:1] 1+a*x+b*x*x
![plot for[a=0:1] for[b=0:1] 1+a*x+b*x*x](../../images/3821669480.webp)
You could do now what you want except for a further problem: in gnuplot
numeric loops variables have only integer values, e.g.,
gnuplot> plot for [s=3.2:9.3:2.9] x title sprintf("%f", s)
![plot for [s=3.2:9.3:2.9] x title sprintf("%f", s)](../../images/3818589308.webp)
so your loop on w
is impossible, you have to devise a different strategy.
With the provision that I don't know what value you want to assign to l
(I've used l=1
) and also that I don't know the step on w
, here it is a possible implementation where the tricks are ❶ define a function that gives you the values of w
in terms of an integer variable and ❷ define x
and y
also in terms of this auxiliary variable
gnuplot> set parametric
gnuplot> w(k) = 2*pi*k
gnuplot> x(t, k)=a+(n/w(k))*(cos(w(k)*t)-1)-((g/w(k)**2)*sin(l)-m/w(k))*(sin(w(k)*t)+(g*t/w(k))*sin(l))
gnuplot> y(t, k) = b + ((g/w(k)**2)*sin(l)-m/w(k))*(cos(w(k)*t)-1)+(n/w(k))*sin(w(k)*t)
gnuplot> g = 7 ; l = 1
gnuplot> plot for[a=0:1] for[b=0:1] for[m=0:1] for[n=0:1] for[k=2:3] x(t,k), y(t,k) title sprintf("%d,%d,%d,%d,%d", a,b,n,m,k)
