Using the following commands
gnuplot> f(x) = a*x
gnuplot> plot for [a = 1:3:1] f(x) title sprintf("a=%d",a)
I get the following plot

You may want to read the descriptions you can get by the following commands
gnuplot> help for
The `plot`, `splot`, `set` and `unset` commands may optionally contain an
iteration for clause. This has the effect of [...]
and
gnuplot> help sprintf
`sprintf("format",var1,var2,...)` applies standard C-language format specifiers
to multiple arguments and returns the resulting string. If you want to
use gnuplot's own format specifiers, you must instead call `gprintf()`.
For information on sprintf format specifiers, please see standard C-language
documentation or the unix sprintf man page.
HTH