Gnuplot:具有不同颜色的数据块

Jea*_*Luc 5 gnuplot

我有一个包含多个的数据文件,例如

x1 y1
x2 y2
x3 y3
x4 y4


x1 y1
x2 y2
x3 y3
x4 y4


x1 y1
x2 y2
x3 y3
x4 y4
Run Code Online (Sandbox Code Playgroud)

我想将每个块默认为不同的颜色.如果这些块中的每一个都在一个单独的文本文件中,这不会是一个问题,因为Gnuplot默认这样做.任何人都知道如何以不同的颜色获得每个地块的块(最好不管我有多少块)?

谢谢.

Chr*_*oph 10

数据块的编号可用作伪列-2.与linecolor variable它一起为您提供您想要的东西:

plot 'data.dat' using 1:2:-2 lc var with lines
Run Code Online (Sandbox Code Playgroud)

使用数据文件:

1 1
2 2
3 3
4 4


1 2
2 3
3 4
4 5


1 3
2 4
3 5
4 6
Run Code Online (Sandbox Code Playgroud)

你得到了结果(4.6.3):

在此输入图像描述