gnuplot-用不同的颜色绘制不同的块 [英] gnuplot - plot different blocks with different color
问题描述
我在file.dat
2 2
5 5
7 3
100 102
130 80
116 134
-40 -100
-50 -60
-61 -58
我想用不同的颜色绘制每个块,
对特定颜色没有限制,而只是一些视觉上不同的颜色.
我这样尝试过linetype
:
for [IDX=0:2] 'file.dat' i IDX u 1:2 with linespoints linetype IDX
它绘制了所有具有不同颜色的块,显然只有最后一个可见.
那么正确的方法是什么?
这是正确的方法,但是必须使用两条空行才能使用index
访问不同的块. >
而且,您应该从linetype 1
开始,因为linetype 0
是网格线的特殊线型:
2 2
5 5
7 3
100 102
130 80
116 134
-40 -100
-50 -60
-61 -58
和绘图命令
plot for [IDX=0:2] 'file.dat' index IDX u 1:2 with lp lt IDX+1
I have a data like this in a file.dat
2 2
5 5
7 3
100 102
130 80
116 134
-40 -100
-50 -60
-61 -58
I would want to plot each block in different color,
There is no restriction that a specific color, but just some visually different color.
I tried with linetype
like this:
for [IDX=0:2] 'file.dat' i IDX u 1:2 with linespoints linetype IDX
it plots all the blocks with different color and obviously only last one is visible.
So what is the right way to do this?
That is the right way, but you must have two blank lines in order to access different blocks with index
.
And, you should start at linetype 1
, because linetype 0
is a special linetype for the grid lines:
2 2
5 5
7 3
100 102
130 80
116 134
-40 -100
-50 -60
-61 -58
And the plot command
plot for [IDX=0:2] 'file.dat' index IDX u 1:2 with lp lt IDX+1
这篇关于gnuplot-用不同的颜色绘制不同的块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!