首页 > 解决方案 > Gnuplot 在同一文件的同一图中使用奇数行和偶数行

问题描述

我有一个具有此值的文件(fio 混合读写结果):

1191, 3987, 0, 0, 0
1191, 11781, 1, 0, 0
2193, 4006, 0, 0, 0
2193, 12431, 1, 0, 0
3195, 3698, 0, 0, 0
3195, 11680, 1, 0, 0
4196, 3897, 0, 0, 0
4196, 11407, 1, 0, 0
5198, 3845, 0, 0, 0

我想分别画一条连接偶数线和奇数线的线。

我想使用这样的东西,但这不起作用:

plot "<(sed -n 'p;n' 8k-mix_iops.4.log)" using $1/1000):2 title "25-75 write" with lines, "<(sed -n 'n;p' 8k-mix_iops.4.log" using ($1/1000):2 title "25-75 read" with lines

或者我可以以某种方式使用每个命令,但我如何定义每一行但从第一行开始或从第二行开始?

plot "8k-mix_iops.4.log" every 2 using ($1/1000):($2) title "25-75 write" with lines, "8k-mix_iops.4.log" every 1 using ($1/1000):($2) title "25-75 read" with lines

标签: linuxgraphgnuplotbenchmarking

解决方案


每个" (您需要按正确顺序关闭。

plot "<(sed -n 'p;n' file)" using ($1/1000):($2) title "25-75 write" with lines, "<(sed -n 'n;p' file)" using ($1/1000):($2) title "25-75 read" with lines;

为我画:

在此处输入图像描述


推荐阅读