为每个标签绘制不同的磅值

时间:2014-02-25 08:44:57

标签: plot gnuplot

如何为不同的标签定义不同的磅值。例如,标签是

100
200
300

我想要定义一个地图,其中ps 1为100,ps 2为200,ps 3为300。

Gnuplot的可行性如何?

更新

数据文件类似于

 100 NaN 100
 NaN 200 NaN
 300 200 NaN

我有这个命令来排除NaN

 symbol(N) = strcol(N) ne "NaN" ? strcol(N) : " "

结果:(symbol(N)*0.1) with points ps var不正确

1 个答案:

答案 0 :(得分:1)

可以使用pointsize variable完成。它使用点大小的附加列的值:

plot 'file.dat' using 0:1:($1*0.01) pointsize variable

对于更新的数据文件,您无需使用strcolNaN在被视为数值时会被忽略:

symbol(N) = strcol(N) ne "NaN" ? strcol(N) : " "
unset key
set offset 0.2,0.2,0.2,0.2
plot for [i=1:3] 'file.dat' using (i-1):0:(symbol(i)) with labels offset char 0,1,\
         'file.dat' matrix using 1:2:($3*0.01) with points pt 7 ps var lt 1

enter image description here