There are many ways you could select the colours, automatically or not.
The linecolor (or lc) specifier can take
- an integer to select one of the builtin line types and its
associated colour,
- a colour name as a string, such as "blue" (in an interactive gnuplot
session, do
show colors to see the full list of available colour
names),
- a colorspec (this can take many forms, do
help colorspec for more
details).
I took the laziest approach I could think of, which is to select colours at random!
I provided to lc a colorspec of the following form:
rgbcolor <integer val> # integer value representing AARRGGBB
In the script below, the <integer val> are generated randomly,
in the range [000000, FFFFFF], where
FFFFFF (base 16) = 16**6-1 (base 10) = 16777215 (base 10).
This selects colours at random within the set of all possible colours
gnuplot supports, ignoring transparency (the AA in AARRGGBB).
unset key
set xrange [0:10]
seed = 4
x = rand(seed)
N = 16**6-1
plot for [i=1:16] x*i lc rgbcolor rand(0)*N
rand(0) gives a number between 0 and 1 so rand(0)*N gives a number between 0 and 16**6-1.
Since the seed is fixed (I picked 4), the sequence of random numbers and the set of
colours is the same every time you run the script. You can try
different seeds until all the line colours look different enough.
With the above script, I get this plot:
