gnuplot不同颜色的单个绘图
我有一列数据(比如100个样本): 但这些数据是分段的:10个点,然后10个点,等等。。。我希望每一个10块都有不同的颜色。我把它们过滤成10个单独的文件,并使用gnuplot不同颜色的单个绘图,gnuplot,Gnuplot,我有一列数据(比如100个样本): 但这些数据是分段的:10个点,然后10个点,等等。。。我希望每一个10块都有不同的颜色。我把它们过滤成10个单独的文件,并使用 plot 'file.1' with lines, 'file.2' with lines... 但是X轴变成0..10而不是0..100,所有10个图形都被叠加。有没有一种不必生成假X数据的简单方法?取决于您的详细数据格式。。。以下是我认为你所要求的。 您的“伪x数据”称为伪列0,请检查帮助伪列。您可以使用lc var更改的颜色,
plot 'file.1' with lines, 'file.2' with lines...
但是X轴变成0..10而不是0..100,所有10个图形都被叠加。有没有一种不必生成假X数据的简单方法?取决于您的详细数据格式。。。以下是我认为你所要求的。 您的“伪x数据”称为伪列0,请检查
帮助伪列
。您可以使用lc var
更改的颜色,请选中help linecolor variable
代码:
### variable line color
reset session
# create some test data
set print $Data
do for [i=1:100] {
print sprintf("%g", rand(0)*i)
}
set print
plot $Data u 0:1:(int($0/10)) w lp pt 7 lc var notitle
### end of code
结果:
### variable line color
reset session
# create some test data
set print $Data
do for [i=1:100] {
print sprintf("%g", rand(0)*i)
}
set print
plot $Data u 0:1:(int($0/10)) w lp pt 7 lc var notitle
### end of code
根据您的详细数据格式。。。以下是我认为你所要求的。 您的“伪x数据”称为伪列0,请检查
帮助伪列
。您可以使用lc var
更改的颜色,请选中help linecolor variable
代码:
### variable line color
reset session
# create some test data
set print $Data
do for [i=1:100] {
print sprintf("%g", rand(0)*i)
}
set print
plot $Data u 0:1:(int($0/10)) w lp pt 7 lc var notitle
### end of code
结果:
### variable line color
reset session
# create some test data
set print $Data
do for [i=1:100] {
print sprintf("%g", rand(0)*i)
}
set print
plot $Data u 0:1:(int($0/10)) w lp pt 7 lc var notitle
### end of code
分段对您来说意味着什么?在你的街区之间用空行隔开还是没有空行?分段对你来说意味着什么?在你的街区之间用空行隔开还是没有空行?是的,就是这样。谢谢,就是这样。谢谢