计算gnuplot中绘制点的数量
数据文件包含以下格式的值:计算gnuplot中绘制点的数量,gnuplot,Gnuplot,数据文件包含以下格式的值: 0 0 50 0 1 70 1 0 40 1 1 70 2 0 110 2 1 60 3 0 60 3 1 120 4 0 50 4 1 50 5 0 70 5 1 70 这是我的gnuplot脚本中的代码片段: plot 'file' using ($3 > 100 && $2 == 0 ? $1 : 1/0): 3 with points pointtype 1,\ 'file' using ($3 > 100 &&
0 0 50
0 1 70
1 0 40
1 1 70
2 0 110
2 1 60
3 0 60
3 1 120
4 0 50
4 1 50
5 0 70
5 1 70
这是我的gnuplot脚本中的代码片段:
plot 'file' using ($3 > 100 && $2 == 0 ? $1 : 1/0): 3 with points pointtype 1,\
'file' using ($3 > 100 && $2 == 1 ? $1 : 1/0): 3 with points pointtype 2
有人能建议一种方法来计算每种点类型的打印点的数量吗?这相对容易,方法是设置一个计数器,然后在满足条件时执行
counter=counter+1
(我已经删除了紧凑性样式):
minval = 100; count1 = 0; count2 = 0
plot 'file' using ($3 > minval && $2 == 0 ? (count1 = count1 + 1, $1) : 1/0):3, \
'file' using ($3 > minval && $2 == 1 ? (count2 = count2 + 1, $1) : 1/0):3
gnuplot> print count1, count2
1 1
minval = 50; count1 = 0; count2 = 0
plot 'file' using ($3 > minval && $2 == 0 ? (count1 = count1 + 1, $1) : 1/0):3, \
'file' using ($3 > minval && $2 == 1 ? (count2 = count2 + 1, $1) : 1/0):3
gnuplot> print count1, count2
3 5