这是我想要绘制的三个文件的数据:
file1
01:12:06 90000
01:12:07 30000
01:12:17 30000
01:12:27 30000
01:12:37 30000
01:12:47 30000
01:12:57 30000
01:13:07 30000
01:13:17 30000
01:13:27 30000
01:13:37 30000
01:13:47 90000
01:13:57 30000
01:14:07 30000file2
01:12:02 90000
01:12:07 30000
01:12:17 30000
...
01:18:47 90000
01:18:57 90000file3
01:12:04 90000
01:12:07 30000
01:12:17 30000
...
01:15:37 45000
01:15:47 45000下面是我用来绘制图形的命令:
gnuplot> set xdata time; set timefmt '%H:%M:%S';
gnuplot> set format x "%H:%M:%S"
gnuplot> set xlabel "time";
set ylabel "Data rates";
set grid;
set xrange ["01:12:04" : "01:18:57"];
set yrange ["0" : "100000"];
set style data linespoints;
plot "file1" using 1:2 title "connection-1", "file2" using 1:2 title "connection-2", "file3" using 1:2 title "connection-3这是生成的图表:

如您所见,file1的点在01:12:06到01:14:07之间,但是图表没有显示来自file1的所有点。对于file3也是如此。要么绘图行是重叠的,要么gnuplot正在丢弃所有这些数据。我想看到这三个文件的3行。
发布于 2014-11-29 12:28:08
考虑到gnuplot用第三行覆盖第一行,我看到了不同的可能性(或多种可能性的组合)。
我有点不喜欢第4点,因为这违背了数据的完整性,但我们是不道德的人,不是吗?
我保证,当我理解Excel使用的解决方案时,我将尝试更新我的答案。
编辑
第2点,我现在意识到了,它并不代表我们问题的独立解决方案,但是在行宽或标记宽度的solution中使用时效果很好。
发布于 2014-11-29 12:26:58
如前所述,第3行的点由a '+‘和'x’组成,因此它们隐藏了第1行('+')和第2行('x')的点。
你可以选择其他的点标记。使用命令test获取可用样式的概述。
例如,
plot ... pointtype 4,\
... pointtype 6,\
... pointtype 8第一个使用正方形,第二个圆圈和第三个三角形。
根据评论:不可能人为地改变线条。但是您可以在值中添加一个常量:
plot "file1" using 1:($2+10) with linespoints pointtype 4 # shift all y-values by 10发布于 2015-03-20 00:38:01
在我的例子中,我首先绘制了重叠最大的数据集。然后,我绘制了数据集的下一个最大重叠的e.t.c。这样,重叠较少的线被画在重叠较大的线(较长的线)之上。特别是这是我的档案:
1, 0.50000000023514612479
2, 0.50000000002351452366
1, 0.50000000023514612479
2, 0.50000000002351452366
3, 0.50000000000235200748
1, 0.50000000023514612479
2, 0.50000000002351452366
3, 0.50000000000235200748
4, 0.50000000000023503421
1, 0.50000000023514612479
2, 0.50000000002351452366
3, 0.50000000000235200748
4, 0.50000000000023503421
5, 0.50000000000001576517
1, 0.50000000023514612479
2, 0.50000000002351452366
3, 0.50000000000235200748
4, 0.50000000000023503421
5, 0.50000000000001576517
6, 0.50000000000000022204阴谋命令:
plot "file.txt" index 4 with linespoints title "alpha:1e-05" , \
"file.txt" index 3 with linespoints title "alpha:1e-04",\
"file.txt" index 2 with linespoints title "alpha:1e-03",\
"file.txt" index 1 with linespoints title "alpha:1e-02",\
"file.txt" index 0 with linespoints title "alpha:1e-01" 然后,您可以使用不同的线宽来区分线。
https://stackoverflow.com/questions/27201638
复制相似问题