对于每周列中的空数据点,该图正在绘制每月列中的值. 每月列图和每日列图非常理想. 除了设置数据文件缺少''并设置数据文件分隔符"\ t"
For empty data points in weekly column , the plot is ploting values from monthly column. Monthly column plot and daily column plot are perfect. suggest something more than set datafile missing ' ' and set datafile separator "\t"
推荐答案A,Gnuplot不支持基于字段的数据文件,当前的唯一解决方案是对文件进行预处理. awk非常适合该任务(请注意,如果文件包含硬标签,则需要调整FIELDWIDTHS):
Alas, Gnuplot doesn't support field based data files, the only current solution is is to preprocess the file. awk is well suited for the task (note if the file contains hard tabs you need to adjust FIELDWIDTHS):
awk '$3 ~ /^ *$/ { $3 = "?" } $4 ~ /^ *$/ { $4 = "?" } 1' FIELDWIDTHS='6 7 8 7' infile > outfile这用问号替换了第3列和第4列中的空白字段(/^ *$/),这意味着Gnuplot尚未定义. awk脚本末尾的1调用默认规则:{ print $0 }.
This replaces empty fields (/^ *$/) in column 3 and 4 with question marks, which means undefined to Gnuplot. The 1 at the end of the awk script invokes the default rule: { print $0 }.
如果将awk的输出发送到outfile,则可以例如现在绘制如下文件:
If you send awk's output to outfile, you can for example now plot the file like this:
set key autotitle columnhead out set style data linespoint plot 'outfile' using 1:2, '' using 1:3, '' using 1:4
更多推荐
具有空数据点的列
发布评论